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

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


  • To: Viktor Mitin <viktor.mitin.19@xxxxxxxxx>
  • From: Jan Beulich <JBeulich@xxxxxxxx>
  • Date: Mon, 29 Jul 2019 12:19:58 +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=zjjVyfccExT3ApdmCBFgDWL0evxGs9wyrLepJZjaBIg=; b=hqYmfszeF+tOjit53ButkVSR8pzqM52TGHWRnEO4yCTkR8464l2sN+w6FA3wRmBaVRRBSoL/AgQaasWihKpHrlCVH5P8Da4m0HhMjmAvX50GfBT4zElkHO0dPSi3PGppvFjOdzW/2Q++8cWZj2Fe+Lw6dpaOAZvtoSMv31g+FbgzDxFf8SJT+YNwtSsBYrOG7Rwd56wx28rf6Vg70cqZEMF4Fz7tuyfyWO8OWcYsp4nR2v4GTG3QvtHJwmmOUpLRbR6ERN5il0ys4GTtWbg4emcpawQl9mfb5tMaw7dz6QzSCt8tad1UysrwgeTtrN5SI5hxGdNq6Ou4OgpnhH1bfQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ewCqS6vcltOUO8OyVvsAfSp5a9XIakpaP4mqZFKb1xierxd7doGx90bo4KCTh+So8TXbFFBPlk/NG4qhaWA+wLKVFJr0mYEBCyJ4coER3BvAiMTJfemt8FEq23SZm/B0+MQcPJkz6uWM7ilua/a4mxHgzZZlY9RMi+GgTn4EJielCtC8DjKozAhlabgEWE6ZsSoMvveagMB6cbA44RlkeOs1IV9SOUyf0SuJQUPfDS7MhSUam+I1N00xkvEi9ZvP5r4WWi3OLzfehg3rU53LlMfgui/j4oVmsw0UKLsxZ7kc/WUXiX9SBpnK07MFvzgMtSw9BB4itqA6sCWBW4p02A==
  • 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>, Julien Grall <julien.grall@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Tamas K Lengyel <tamas@xxxxxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 29 Jul 2019 12:37:38 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVPXcqh/rpHqCfrE2r6qBBgy1Fu6bQeNoBgAADe8CAAAegOoAMhBoBgASM1gA=
  • Thread-topic: [Xen-devel] [RFC] xen: Add .astylerc for automated style-formatting

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.

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®.