All of lore.kernel.org
 help / color / mirror / Atom feed
From: George Dunlap <George.Dunlap@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Julien Grall <julien@xen.org>,
	Bertrand Marquis <Bertrand.Marquis@arm.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Andrew Cooper <Andrew.Cooper3@citrix.com>,
	Roger Pau Monne <roger.pau@citrix.com>,
	Stefano Stabellini <stefano.stabellini@xilinx.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH 1/2] docs/misra: introduce rules.rst
Date: Mon, 30 May 2022 10:21:47 +0000	[thread overview]
Message-ID: <A7121189-9A68-41C6-A8EF-D823A0BBF4FF@citrix.com> (raw)
In-Reply-To: <dcafd462-f912-8c59-f1bf-32f65ae45fd4@suse.com>


[-- Attachment #1.1: Type: text/plain, Size: 3447 bytes --]



> On 30 May 2022, at 10:55, Jan Beulich <jbeulich@suse.com <mailto:jbeulich@suse.com>> 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.

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.

 -George

[-- Attachment #1.2: Type: text/html, Size: 7603 bytes --]

[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2022-05-30 10:22 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-25  0:34 [PATCH 0/2] introduce docs/misra/rules.rst Stefano Stabellini
2022-05-25  0:35 ` [PATCH 1/2] docs/misra: introduce rules.rst Stefano Stabellini
2022-05-25  7:39   ` Julien Grall
2022-05-26  1:02     ` Stefano Stabellini
2022-05-26  9:43       ` Jan Beulich
2022-05-26  9:54         ` Bertrand Marquis
2022-05-26 10:15           ` Jan Beulich
2022-05-26 13:04             ` Bertrand Marquis
2022-05-26 19:57               ` Stefano Stabellini
2022-05-27  6:56                 ` Jan Beulich
2022-05-27 23:16                   ` Stefano Stabellini
2022-05-30  8:37                     ` Jan Beulich
2022-05-30  9:12                     ` Julien Grall
2022-05-30  9:16                       ` Jan Beulich
2022-05-30  9:27                         ` Julien Grall
2022-05-30  9:33                           ` Jan Beulich
2022-05-30  9:41                             ` Julien Grall
2022-05-30  9:55                               ` Jan Beulich
2022-05-30 10:21                                 ` George Dunlap [this message]
2022-05-30 13:35                                   ` Bertrand Marquis
2022-05-31  9:41                                     ` Julien Grall
2022-06-01  1:25                                       ` Stefano Stabellini
2022-05-25  8:25   ` Jan Beulich
2022-05-26  1:12     ` Stefano Stabellini
2022-05-26  9:36       ` Jan Beulich
2022-05-26 19:57         ` Stefano Stabellini
2022-05-25 12:21   ` Andrew Cooper
2022-05-26  1:57     ` Stefano Stabellini
2022-05-25  0:35 ` [PATCH 2/2] docs/misra: add Rule 5.1 Stefano Stabellini
2022-05-25  7:40   ` Julien Grall
2022-05-25 12:26     ` Andrew Cooper
2022-05-25  8:08   ` Jan Beulich
2022-05-26  1:18     ` Stefano Stabellini
2022-05-26  9:40       ` Jan Beulich
2022-05-26 10:10         ` Bertrand Marquis
2022-05-26 19:58         ` Stefano Stabellini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=A7121189-9A68-41C6-A8EF-D823A0BBF4FF@citrix.com \
    --to=george.dunlap@citrix.com \
    --cc=Andrew.Cooper3@citrix.com \
    --cc=Bertrand.Marquis@arm.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=stefano.stabellini@xilinx.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.