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

Re: Clang-format configuration discussion - pt 2


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Tue, 5 Dec 2023 13:46:15 +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=MkcRtQSt+ZngtZUfvVnKnyw+5YWnh/NRGw5LsMRqcrI=; b=nT9upRfQdYPT8Wmp5+etYoqXE7r6taPBSp42Q3txskPTWxIPPW//qR+HNpF/iOA4S3qMmNRNWA627afBZJQ8QVKjgAjYFLmQIJIv2OPrxheoSIcfYibIUxHuuPmnJWNSjw26zlZMfMMnRZo2oclC9++cVG9LloplIU5p4yMZPuDiR89JbukCTJbsB4G/SDnLeNvYOfpeJfgONxfyYslUWGo09yMsY+ZLyYV6x0pAIDRL/NumkKqw5Z0NGhtjZ01j0KYBHwfFpg9DUslIq/FUeBLPwCJXr6x5UjHM8k1tEE3hW4t369EUiY5y02koHPPaCwTQkNRBfMQrEAqTzX9SXg==
  • 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=MkcRtQSt+ZngtZUfvVnKnyw+5YWnh/NRGw5LsMRqcrI=; b=n1/njHfo34LECIOTiXfu8o3RyhK9Dy8PyNRJhuO3OJjJhTWKvDWunfdAZ641ywuVSwrVdFGqpCIlZaHJOOd5zDDzRhU9rpzQMPV9Z5bzWuQrikAvoeVqJzVe8Kmodv2/yKARAFhx/h9bmhS6aZ4uYlxWOSdGldWGflY+03o1klPdgVzRnv4AnT+c+JPppjFZPHGQTrDt3LP7EmEYqwWkmywyv2bZK4h6hWf/9iwPZLoOu2IXW5Z6kmwLh33Jc72qA+lXK54X/KvAUs6yWIf5LgOCpBk1zu7ugp5P05Yb4tGEk2SLT3Yza2o1Rx3ZhpJFxKaWutXh6gOJOD5VCtJIdQ==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=TnLFqyNrcx6pXVq5ThqlOUc72W3MYzqi1f2e+SV9e5T/1RVmWmuMGWNAkMDH/7Bs0vTkaULtHT/wVhLGRnkAxj6SnXixUm46FsdDZq4x9Mg+SRyZaabL+khUe/WHo/H8wYEdxigmDI2vPfV9pVabMwYqpbCVuqhUbqi0LlekwrNXB2FNvmK+161cE5aKsW4Z17zwuviGEb4/bGVo4JLnSB5FddGEWNtp+0likL+h6FEjuvZarCaUEGBQI9dKHQSn/Nuo0QHWdZ3884hD8NqRx9afWuGgMwCsUHA+Bi+yW9BI0qIjhbJefb0qNTtey86ZygXHWFIbGeFoP/mR9mZfCQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PPKTi91qEeXLEWunAXY+CDcyxV33gLcB6U+uV8yFyqFiJQqU12D+Cfa5H71Pkq0kgltuRsBloBz/s8toufBq1pt7+A1MysFCDfZ7E3/A9yynLnfj1sv6UKLkUh3PgeO5I5hDeQSCLTFRfM3l0+KGONKj5OX8tGZ57u0mWxDY4KDsWw8ysPws2qfUqeWGP5XRRD1jabUvBY2nHnBgWZnBtaJHy19M2zeOXUpbWnFGq+AJOkAVlvIaVLV2yWzvEUuZOhDRFae2eB/aN6FnJymMJku4jpg43Px+HK2qdBROUsdlc8VEgHASqpFcYUYI1yR1vvYNlPwxiGaeVSaqobIIZQ==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Michal Orzel <Michal.Orzel@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Tue, 05 Dec 2023 13:46:43 +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: AQHaHhwDfni7SbjBtk6S7YLD/w4HebCaxpCA
  • Thread-topic: Clang-format configuration discussion - pt 2


> On 23 Nov 2023, at 14:47, Luca Fancellu <Luca.Fancellu@xxxxxxx> wrote:
> 
> Hi all,
> 
> Let’s continue the discussion about clang-format configuration, this is part 
> 2, previous discussions are:
> 
> - https://lists.xenproject.org/archives/html/xen-devel/2023-11/msg00498.html
> 
> You can find the serie introducing clang-format here:
> https://patchwork.kernel.org/project/xen-devel/cover/20231031132304.2573924-1-luca.fancellu@xxxxxxx/
> and there is also a patch linked to my gitlab account where you can find the 
> output for the hypervisor code.
> 
> For a full list of configurables and to find the possible values for them, 
> please refer to this page:
> https://clang.llvm.org/docs/ClangFormatStyleOptions.html
> 
> --------------------------------------------------------------------------------------------------------------------------------------------------
> 

[...]

> 
> --------------------------------------------------------------------------------------------------------------------------------------------------
> 
> AlignAfterOpenBracket: Align
> 
> ---
> This one is to align function parameters that overflows the line length, I 
> chose to align them
> to the open bracket to match the current codebase (hopefully)
> 
> e.g.:
> someLongFunction(argument1,
>                                 argument2);
> 
> This one can be a candidate for an entry in our coding style
> 
> --------------------------------------------------------------------------------------------------------------------------------------------------
> 
> AlignArrayOfStructures: Left
> 
> ---
> “When using initialization for an array of structs aligns the fields into 
> columns."
> It’s important to say that even if we specify “None”, it is going to format 
> the data structure anyway,
> I choose left, but clearly I’m open to suggestions.
> 
> I don’t know how to phrase this one in our coding style
> 
> --------------------------------------------------------------------------------------------------------------------------------------------------
> 
> AlignConsecutiveAssignments: None
> 
> ---
> This one is disabled because of feedbacks from Stefano and Alejandro about 
> some weird behaviour on our
> codebase.
> 
> This one could be phased along this line: “Consecutive assignments don't need 
> to be aligned.”, the issue is
> that in this way it seems that it’s optional, but clang-format is going to 
> remove the alignment anyway for
> assignment that are consecutive and aligned.
> 
> --------------------------------------------------------------------------------------------------------------------------------------------------
> 
> AlignConsecutiveBitFields: None
> 
> ---
> Same thing as AlignConsecutiveAssignments, but for bitfields.
> 
> --------------------------------------------------------------------------------------------------------------------------------------------------
> 
> AlignConsecutiveDeclarations: None
> 
> ---
> This aligns declarations names, same considerations as 
> AlignConsecutiveAssignments.
> 
> --------------------------------------------------------------------------------------------------------------------------------------------------
> 
> Ok this is it for now, let me know your thoughts about them, ideally if I 
> don’t get any reply in two weeks (7th of December),
> I will consider that we have an agreement on these configuration.

Hi all,

Just a ping for who wants to say his thoughts about this, Jan already made 
clear his concerns about the lack of flexibility
of the tool, which would provide a default formatting without leaving the 
option to leave the code as it is, making the tool
not fit in his opinion to the use on our codebase.

In my opinion, I don’t know of any tool that can address all the flexibility 
the Xen codestyle allows, yet the use of automatic
checkers would improve the review time, allow more new contributors to approach 
the community without being put down by
the amount of code-style comments, consolidate the style across the codebase.

So, please maintainers, let me know your thoughts on that or please say clearly 
that we are not ready yet to use an
Automatic code style checker.

Cheers,
Luca



 


Rackspace

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