All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien@xen.org>
To: "Jürgen Groß" <jgross@suse.com>,
	"Tamas K Lengyel" <tamas.k.lengyel@gmail.com>
Cc: "paul@xen.org" <paul@xen.org>, Julien Grall <jgrall@amazon.com>,
	"committers@xenproject.org" <committers@xenproject.org>,
	Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"Woodhouse, David" <dwmw@amazon.co.uk>
Subject: Re: Xen Coding style
Date: Fri, 8 May 2020 16:50:30 +0100	[thread overview]
Message-ID: <f24a6c04-e11d-ae64-3d9a-cb3ad1ac3c14@xen.org> (raw)
In-Reply-To: <d0be31c1-f5fe-30ba-9c1a-5d37333d2479@suse.com>



On 08/05/2020 15:42, Jürgen Groß wrote:
> On 08.05.20 16:23, Tamas K Lengyel wrote:
>> On Fri, May 8, 2020 at 8:18 AM Jürgen Groß <jgross@suse.com> wrote:
>>>
>>> On 08.05.20 14:55, Tamas K Lengyel wrote:
>>>> On Fri, May 8, 2020 at 6:21 AM Julien Grall <julien@xen.org> wrote:
>>>>>
>>>>> Hi Jan,
>>>>>
>>>>> On 08/05/2020 12:20, Jan Beulich wrote:
>>>>>> On 08.05.2020 12:00, Julien Grall wrote:
>>>>>>> You seem to be the maintainer with the most unwritten rules. Would
>>>>>>> you mind to have a try at writing a coding style based on it?
>>>>>>
>>>>>> On the basis that even small, single aspect patches to CODING_STYLE
>>>>>> have been ignored [1],
>>>>>
>>>>> Your thread is one of the example why I started this thread. 
>>>>> Agreeing on
>>>>> specific rule doesn't work because it either result to bikesheding or
>>>>> there is not enough interest to review rule by rule.
>>>>>
>>>>>> I don't think this would be a good use of my
>>>>>> time.
>>>>>
>>>>> I would have assumed that the current situation (i.e
>>>>> nitpicking/bikeshedding on the ML) is not a good use of your time :).
>>>>>
>>>>> I would be happy to put some effort to help getting the coding style
>>>>> right, however I believe focusing on an overall coding style would 
>>>>> value
>>>>> everyone's time better than a rule by rule discussion.
>>>>>
>>>>>> If I was promised (reasonable) feedback, I could take what I
>>>>>> have and try to add at least a few more things based on what I find
>>>>>> myself commenting on more frequently. But really I'd prefer it to
>>>>>> be done the other way around - for people to look at the patches
>>>>>> already sent, and for me to only subsequently send more. After all,
>>>>>> if already those adjustments are controversial, I don't think we
>>>>>> could settle on others.
>>>>> While I understand this requires another investment from your part, 
>>>>> I am
>>>>> afraid it is going to be painful for someone else to go through all 
>>>>> the
>>>>> existing coding style bikeshedding and infer your unwritten rules.
>>>>>
>>>>> It might be more beneficial for that person to pursue the work done by
>>>>> Tamas and Viktor in the past (see my previous e-mail). This may 
>>>>> mean to
>>>>> adopt an existing coding style (BSD) and then tweak it.
>>>>
>>>> Thanks Julien for restarting this discussion. IMHO agreeing on a set
>>>> of style rules ahead and then applying universally all at once is not
>>>> going to be productive since we are so all over the place. Instead, I
>>>> would recommend we start piece-by-piece. We introduce a baseline style
>>>> checker, then maintainers can decide when and if they want to move
>>>> their code-base to be under the automated style checker. That way we
>>>> have a baseline and each maintainer can decide on their own term when
>>>> they want to have their files be also style checked and in what form.
>>>> The upside of this route I think is pretty clear: we can have at least
>>>> partial automation even while we figure out what to do with some of
>>>> the more problematic files and quirks that are in our code-base. I
>>>> would highly prefer this route since I would immediately bring all
>>>> files I maintain over to the automated checker just so I never ever
>>>> have to deal with this again manually. What style is in use to me
>>>> really doesn't matter, BSD was very close with some minor tweaks, or
>>>> even what we use to check the style just as long as we have
>>>> _something_.
>>>
>>> Wouldn't it make more sense to have a patch checker instead and accept
>>> only patches which change code according to the style guide? This
>>> wouldn't require to change complete files at a time.

So what are you going to do if a new contributor is unfortunate enough 
to modify code that doesn't pass the coding style checker? Are we going 
to impose him/her to fix the coding style before submitting his patch?

>>
>> In theory, yes. But in practice this would require that we can agree
>> on a style that applies to all patches that touch any file within Xen.
>> We can't seem to do that because there are too many exceptions and
>> corner-cases and personal-preferences of maintainers that apply only
>> to a subset of the codebase. So AFAICT what you propose doesn't seem
>> to be a viable way to start.
> 
> I think long ago we already agreed to have a control file which tells a
> style checker which style to apply (if any). As a start we could have a
> patch checker checking only the commit message (has it a Signed-off-by:
> etc.). The next step would be to add the control file, and the framework
> to split the patch into the changed file hunks and passing each hunk to
> the correct checking script (might be doing nothing in the beginning).
> And then we could add some logic to the single checkers.

Yes the framework can be written down now (patches are welcomed). But 
this doesn't resolve the underlying problem. Aside files imported from 
Linux, what is the coding style of Xen?

The best way to describe it at the moment is a collection of unwritten 
rules that can differ even between maintainers of the same component. I 
don't really see how we could write a style checker based on this.

The best way to reduce the burden on reviewer and bikeshedding is by 
formalizing what our coding style. With that, we can write a style 
checker effectively and all sort of other tools.

It would prefer to have a common one but we could consider small quirks 
per components if it is necessary.

Cheers,

-- 
Julien Grall


  reply	other threads:[~2020-05-08 15:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-07 14:43 Xen Coding style Julien Grall
2020-05-08  8:36 ` Jan Beulich
2020-05-08 10:00   ` Julien Grall
2020-05-08 11:20     ` Jan Beulich
2020-05-08 12:19       ` Julien Grall
2020-05-08 12:55         ` Tamas K Lengyel
2020-05-08 14:18           ` Jürgen Groß
2020-05-08 14:23             ` Tamas K Lengyel
2020-05-08 14:42               ` Jürgen Groß
2020-05-08 15:50                 ` Julien Grall [this message]
2020-05-08 15:56                   ` Jürgen Groß

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=f24a6c04-e11d-ae64-3d9a-cb3ad1ac3c14@xen.org \
    --to=julien@xen.org \
    --cc=committers@xenproject.org \
    --cc=dwmw@amazon.co.uk \
    --cc=jbeulich@suse.com \
    --cc=jgrall@amazon.com \
    --cc=jgross@suse.com \
    --cc=paul@xen.org \
    --cc=tamas.k.lengyel@gmail.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.