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

Re: [Xen-devel] [RFC] xen: Add .astylerc for automated style-formatting


  • To: Julien Grall <julien.grall@xxxxxxx>
  • From: Jan Beulich <JBeulich@xxxxxxxx>
  • Date: Mon, 29 Jul 2019 13:02:41 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=suse.com;dmarc=pass action=none header.from=suse.com;dkim=pass header.d=suse.com;arc=none
  • 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-SenderADCheck; bh=IaCubTQeP85dAvVKUxBItvUGNqHNYpVRy21ohAbdPCY=; b=fZOW+IQTSfgzrTb8nFVdSiJ8m2cu65gopMSKKGoRVN0LYL6YPCGM9890nQ7KvvAoSSxVseLjXhvFKWNvj2TZ4239RpUac9w1O4QCLFNi1jimEgx4lKnw88KYRvdLdDEggjIYIFWf/prJKWZc87bLyMNSRje4ECu9AH9pvH0+XcSKnbTC2gJoPppzScZfp8Vpb5n7kqlQIl8rxt6W0llc4pCLLJQvbABgzWFFi54OnIFvi1BJ1mtFGqRZdWKayT64RfwGiSxP2Nbx/AUUW2pEhiarp3Mu6EN/5JosVQ1DL2ln2MkV6FtSyP7k/1o/u041+7nB9yDjQyQ7F4AOL48VPA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c5bsyWKS09CyK+XXIGfeJJy/pv6XH2FEBIjYp18Dm3BZPxKK4SeAORglGmxmeSI3t0N07HzOq5WFUWM3Wj5dadcRfSYa4m4WvNzy+OiikcfFvw+lacvrcjFp7Y+OGAVoKcgFW0ONNWMm6LET1rGF+6OPnh0x6xgrp81YArlepg5OHF79d5jBzOKYkmQm5PmDMd4E7esU0/Jef539hypoIDxAyzHtgV0dA+JZCLMIGh033FZwwm8f4pEgrCeNEkDzOV+6gOrdr7jD24Mn24mKv6Sy3wxto+JuYFEnhe1Wwac8WLnsvoEFe+Kdx22AP3Lh21RcjxDGPuj5XuJTM2NOxg==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=JBeulich@xxxxxxxx;
  • Cc: Artem Mygaiev <Artem_Mygaiev@xxxxxxxx>, Lars Kurth <lars.kurth@xxxxxxxxxx>, Iurii Artemenko <Iurii_Artemenko@xxxxxxxx>, Wei Liu <wl@xxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Ian Jackson <ian.jackson@xxxxxxxxxxxxx>, Tim Deegan <tim@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Tamas K Lengyel <tamas@xxxxxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Viktor Mitin <viktor.mitin.19@xxxxxxxxx>
  • Delivery-date: Mon, 29 Jul 2019 13:21:44 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVPXcqh/rpHqCfrE2r6qBBgy1Fu6bQeNoBgAADe8CAAAegOoAMhBoBgASM1gCAAAh2qIAAA3yA
  • Thread-topic: [Xen-devel] [RFC] xen: Add .astylerc for automated style-formatting

On 29.07.2019 14:49, Julien Grall wrote:
> Hi Jan,
> 
> On 7/29/19 1:19 PM, Jan Beulich wrote:
>> On 26.07.2019 16:49, Viktor Mitin wrote:
>>> Hi Julien, All,
>>>
>>> On Thu, Jul 18, 2019 at 6:44 PM Julien Grall <julien.grall@xxxxxxx> wrote:
>>>>
>>>> Hi Tamas,
>>>>
>>>> On 7/18/19 4:14 PM, Tamas K Lengyel wrote:
>>>>> On Thu, Jul 18, 2019 at 9:02 AM Julien Grall <julien.grall@xxxxxxx> wrote:
>>>>>>
>>>>>> Hi Tamas,
>>>>>>
>>>>>> Adding Lars, Artem and Iurii. Iurii has been working on a version for
>>>>>> clang-format recently.
>>>>>>
>>>>>> On 7/18/19 3:43 PM, Tamas K Lengyel wrote:
>>>>>>> Using astyle (http://astyle.sourceforge.net) can greatly reduce the 
>>>>>>> overhead of
>>>>>>> manually checking and applying style-fixes to source-code. The included
>>>>>>> .astylerc is the closest approximation of the established Xen style 
>>>>>>> (including
>>>>>>> styles not formally spelled out by CODING_STYLE but commonly requested).
>>>>>>>
>>>>>>> Checking the comment styles are not included in the automation.
>>>>>>>
>>>>>>> Incorporating Xen's exception to the do-while style is only partially 
>>>>>>> possible,
>>>>>>> thus a change is proposed to the CODING_STYLE of moving the brace from 
>>>>>>> "do {"
>>>>>>> to the next line.
>>>>>>>
>>>>>>> Most of Xen's code-base is non-conforming at the moment: 289 files pass
>>>>>>> unchanged, 876 have some style issue
>>>>>>>
>>>>>>> Ideally we can slowly migrate the entire code-base to be conforming, 
>>>>>>> thus
>>>>>>> eliminating the need of discussing and enforcing style issues manually 
>>>>>>> on the
>>>>>>> mailinglist.
>>>>>>
>>>>>> I quite like the idea of an automatic coding style checker. However, it
>>>>>> is a bit concerning that not even a 1/3 of the files are able to pass
>>>>>> the coding style you suggest. Could you explain whether this is because
>>>>>> the files does not already follow Xen coding style or is it just the
>>>>>> difference with astyle?
>>>>>>
>>>>>> What are the main style issues?
>>>>>
>>>>> Looks like a lot of files that don't follow the Xen coding style
>>>>> as-is. Alignment issues seem to me to be the most common errors. See
>>>>> the full diff here:
>>>>>
>>>>> https://gist.github.com/tklengyel/c5cac14a0d57f119dd7747a1be6fb260
>>>>>
>>>>> We can perhaps tune some aspects of it we disagree with the astyle
>>>>> generated style and try to override it. I did my best to make it
>>>>> conform to the existing Xen style but certainly there could be other
>>>>> tweaks made to reduce the churn.
>>>>
>>>> I think we definitely want to avoid churn as this is going to take a lot
>>>> of time to fix all the places to the new indentation.
>>>>
>>>> Going through the diff I can see major differences with the Xen Coding
>>>> style and also what looks like inconsistencies from the tools itself:
>>>>      - Line 58: This is fairly common to indent the parameters as it is
>>>> today. But then on line 158/272 it indents as we do today. So I am not
>>>> sure what the expected coding style from the tools.
>>>>      - Line 67: I believe Jan request the space before label
>>> Seems agreed not to add the spaces before label. Right?
>>
>> Certainly not, afaia. I will object to any written down rule disallowing
>> leading blank(s) altogether. I will argue for making mandatory at least
>> one blank of indentation.
> 
> Coding style are a matter of taste. If everyone is going to say "I want
> this in the coding style", then we are going to spend countless of hours
> bike-shedding. This is not how we should use our already limited time.

I agree with what you say in general, but not in this specific case: I've
explained why the leading blank(s) are wanted here. This is not because of
my taste, but because of helping with patch review.

Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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