[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/2] docs/misra: introduce rules.rst


  • To: George Dunlap <george.dunlap@xxxxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Mon, 30 May 2022 13:35:02 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=m9H14ODKESzObRYbib1NHPXEfCCsVmJYuV9g5hRVU8Q=; b=X2E6xOJHwhMjhh1OB1ZM5y91EVjkO+Z4toBhS7GItxem+WJqDjOcj3NyhqXZPlYcU9X/zRIEpNq/u+w63+OFQ2n1bYFBYQb5LFEkrFiwZyYoHFCWGi2GdA7mJJCdv2+5BnDsk8jhIMiBH47WP9ProqQ34aX7L6I3DHHuChJ3PPqJfzFeCcOLVeKhomkeQG7jXpRNuXh+/U5qZP6zrcaqw5Ap1SVbKZxwcACLoPfT92HtEXp8CorQ+t7a+ixZBBBeYFWD9mgfWdb/Vgatfi79hSrWekYqd31RdloF+BnMbVkD6WQZjHLN2Byrklh1UdbxOhmXoFfoHVU/o6p7UMFAaQ==
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=m9H14ODKESzObRYbib1NHPXEfCCsVmJYuV9g5hRVU8Q=; b=dSyYpJkYqcd0prjXqtO6SdfgQWFHVAnMiBwNm3ek6zZklBPdRxcMy9OE83dcxjV6rVs7UVpRUyaWPtpGCM15g3xcYRZtt95/OZhc2MaY1/uFLySRG47fzIUeacbB8MQmKa4obd3R/1BARz1220XD73wzdzSsp9JGBjOUp/UiGv1wRIP5Vwzz0TdaXsnVObFS0/JCkAzHwQ3vd++MAjHUVZj9rLq/pFIZ+N9qwcSYvCWH5yt4x33kTzMYHckBlxecfdqW2gwqfZ4ZT9lqNZVFOdroC4p59aSLZZDRRNoTTQ9moqj3/MFZjMopG2dcUeStUz+DcHKvFmWwB27i1/Vs9g==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=gXMBOZhs9dKS5fJNXRsW2X+N/+OngxRIwqUDt1jxJbjCcHF2Mr2m47O6U76EpjkdsABdAp3hamHy7w0jJHZndWhjwjiu/PYfSQFS+7JPqmA4LbkOGwl0DgSqOcqJhIt26Ts/Ulx8ZB+umY5YBPp4psjG6KdctPu83K4A29Cyifz/cDmAWIbkQy9n2GDlq4apRn4yMQi5ax+/M97CaPSufV1hxiPu+UWYfuKVS/PDP1lzU1sg5rST5/S+V3dITbTfl5QD7ZuCTql1YT4as3D+qo+YGOCkWDCGmNLQ+wZjh4tnfB5KXirkEeT7XQXXUDuEekgZb6nE57OQntjayQxe8Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kEUM5KZzbuqymaA+aghRdguDkkYq/HNMy3qp8ubU4eyNQv2S97/lsPDaN9ZrJJtic1veMwtzpS0mPBnUxmUFtZ7gHY/uDnsVEdIRov5RTtGZSkQuYupPCxjXVtVnOcAd8Ox6cA05WJsnEHdFmpWaog6QQH5MITOArZMwRy+D/APLdIbIOCk68kCn8o1389xfPm7HGUf1fY9TmpiYlL0Xsrd7UyFX0CobF8uB0DU0OdTYxqNEirznacjM42Oip29yL55/j0m0JS3PM6lfqkQNdNyJ/0ar9XbcFUVKjICO0kDKsmE3qASn/ZgEPaO19e4HjJIEGj+JiRqHnJ0Jz+83ww==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Mon, 30 May 2022 13:35:28 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHYb89Ql1y5oYxB8EW1dQIiqL2u/a0vNXYAgAEjhQCAAJGbAIAAAxAAgAAFpwCAAC97AIAAc0MAgAC4OQCAARHVgIADyvaAgAABVgCAAALZAIAAAdqAgAACLACAAAPcAIAAB2OAgAA1/YA=
  • Thread-topic: [PATCH 1/2] docs/misra: introduce rules.rst

Hi,

> On 30 May 2022, at 11:21, George Dunlap <george.dunlap@xxxxxxxxxx> wrote:
> 
> 
> 
>> On 30 May 2022, at 10:55, Jan Beulich <jbeulich@xxxxxxxx> wrote:
>> 
>> On 30.05.2022 11:41, Julien Grall wrote:
>>> 
>>> 
>>> On 30/05/2022 10:33, Jan Beulich wrote:
>>>> On 30.05.2022 11:27, Julien Grall wrote:
>>>>> Hi,
>>>>> 
>>>>> On 30/05/2022 10:16, Jan Beulich wrote:
>>>>>> On 30.05.2022 11:12, Julien Grall wrote:
>>>>>>> On 28/05/2022 00:16, Stefano Stabellini wrote:
>>>>>>>> """
>>>>>>>> It is possible that in specific circumstances it is best not to follow 
>>>>>>>> a
>>>>>>>> rule because it is not possible or because the alternative leads to
>>>>>>>> better code quality. Those cases are called "deviations". They are
>>>>>>>> permissible as long as they are documented, either as an in-code 
>>>>>>>> comment
>>>>>>>> or as part of the commit message. Other documentation mechanisms are
>>>>>>> 
>>>>>>> I would drop the "as part of the commit message" because it is a lot
>>>>>>> more difficult to associate the deviation with a rationale (the code may
>>>>>>> have been moved and you would need to go through the history).
>>>>>> 
>>>>>> But this was added in response to me pointing out that code comments
>>>>>> aren't standardized yet as to their format. The alternative, as said
>>>>>> before, would be to come up with a scheme first, before starting to
>>>>>> mandate playing by certain of the rules (and hence requiring deviations
>>>>>> to be documented).
>>>>> 
>>>>> I don't think this is necessary short term. It is easy to rework a
>>>>> comment after the fact. It is a lot more difficult to go through the
>>>>> history and find the rationale.
>>>> 
>>>> We all know what "short term" may mean - we may remain in this mode of
>>>> operation for an extended period of time. It'll potentially be quite a
>>>> bit of churn to subsequently adjust all such comments which would
>>>> have accumulated, and - for not being standardized - can't easily be
>>>> grep-ed for.
>>> 
>>> Well... Scanner will likely point out the issues we deviate from. So you 
>>> we have an easy way to know where the comments need to be adjusted.
>>> 
>>>> By documenting things in the commit message the state of
>>>> the code base doesn't change, and we'll continue to rely on scanners
>>>> to locate sets of candidates for adjustment or deviation commentary.
>>> 
>>> The part I am missing how documenting the deviations in the commit 
>>> message help... Can you clarify it?
>> 
>> I understood Stefano for this to merely be for the purpose of justifying
>> the deviation (preempting review comments).
> 
> Right, so at a very minimum, if we say “This is a rule now”, and a submitter 
> wants a deviation from that rule, then the reviewer needs to know the 
> justification for the deviation.  The commit message is the obvious place for 
> that.

Agree

> 
> Obviously something *else* we might want is a more convenient way to keep 
> that rationale for the future, when we start to officially document 
> deviations.  Given that the scanner will point out all the places where 
> deviations happen, I don’t think an unstructured comment with an informal 
> summary of the justification would be a problem — it seems like it would be a 
> lot easier, when we start to officially document deviations, to transform 
> comments in the existing codebase, than to search through the mailing lists 
> and/or git commit history to find the rationale (or try to work out unaided 
> what the intent was).  But I don’t have strong opinions on the matter.

Maybe agreeing on a simple tag to start that can later be improved (Luca 
Fancellu on my side will start working on that with the FuSa SIG and Eclair 
next month).

So I would suggest:

/**
 * MISRA_DEV: Rule ID
 * xxxxx justification
 *
 */

Whenever we will have defined the final way, we will replace those entries with 
the new system.

Would that be an agreeable solution ?

Regards
Bertrand


> 
>  -George


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.