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

Re: [RFC PATCH v2 7/8] xen: Add clang-format configuration


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Thu, 2 Nov 2023 16:13:45 +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=fHVk9NfprxMDWjhg0e2LFxw/0tPRa/j0xCn7MrkIwgk=; b=J/sGJkF3BZA1f53wwa43fA9cDI7yKZoKb3tvncJIZVZ89bXhdTWN/phLydJOXyOyyRZ0xanweZ/s3qHL7EGmYwe4+bRuHDalH2bJsItyGleC2uoW4vs2G2T1GvNHD3agEKgZXYvLxKfJImR1pO3csYJV8GMIcVCVaFFXHAea0z+WNBfxu1tS6aSncGYTqnChRcglTXy2JxcSEHeomy57ZYuyQDI+uFP48zlXTHrp6a+cT7dZF0f+rNPfSajjC1LdU0nHAnFV1JeiG/zCNlkHo53YaFM8KnT3kdCCYV95K+37Lb4jY4xUift20euxU21L38hBPcZ16+ROa3MxoPtOpw==
  • 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=fHVk9NfprxMDWjhg0e2LFxw/0tPRa/j0xCn7MrkIwgk=; b=ebLqLlptiTPRGWAfg6WsyFATL9TPzkFGjM2o7YmuWRV2Eht/xHsl3PTw5M9G4pK58ln2nZyZb/g05inyXSySxHRaK/A5HBl610+A2fg157T2Pazh88a4iITjcdVksZxpnyn7fCd/V18EgaUdZNjjsfkZVQ5i3xkulS/GbR8EMRzsmY2I6nZ4f33bxMuyTaECD/dutEgIqOFEGyyoqHmDvlkgJLySMw5FLW2l7BD0yiYjL33LBt1GHHMMmVLTsxqhKC+uqHvKeSLYDUyELM8aZLSYY1eEbHSJM26Y3plW8JChIvpmC2P7zxs13SOL9u4KXEBFvhpbqT2bP1OFPUeFKw==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=mOzMeMickPDEf94OVCntZN+3lj9LIVasVBtooAI+GPX6OdgLK3aMN77BqHdRm8MkGqn6ErocuAkM+lMVx8wLE7zrJjbBGpwMjNPhPIVTJ5sK19qFMZ86mdues1PWzYvUxmzJduJKhiFLRELnUXXJpKYAXtMt5t72HLo6GV6fOnzE2yA6KduvOrRlNBv6snXstioH+U+RzFtUxgFO1bT8uvlnBB/PdC4lieh9BQw4VqCwIB/agY6cWb1OL6qKPqQQfHb+OGlpqzUlOka4cwOG7TZtOLWwGPb5R+Swpeglx0K2/LAJXYq287BVvpdmsDqcZK2szU25l4ODuiIlyIw8Zg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ivXrWWVtiFlRdgVYu2Wfp6/CB1pUnYOpnNm1PQTeheE6IkTEM0+fHK0CE6JPZiEMAIYF8oWqalcuBTVJATTj9o5gC2Y9Vr5AS9G9gOxKK11c0ukenE6EKzN7zELd0LKGalF8BvAowrXgU7R4/1yIegupiFAJ5rCTGNmNBLe+KAevEl/h7yNKZ+ce+mt4+WbcOwh1+wOVs1mS11gNKhYNtdZGUBJ1qWJ0GtW08Th81RyHiUfUCmAQ7WkO3mc0f9zAfCkg18MpeMC/h/BQDnHjw5RDZDdve4yfbcJxJcN1oq1GeiJcZPBDbFEsHTaYVJxgabmszzWnpKJLv1tl3DzrtQ==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 02 Nov 2023 16:14:25 +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: AQHaC/2DXZmPSKf8g0iXRwPyHo/7ZrBmwPcAgAAqKoCAAAMlAIAASM0A
  • Thread-topic: [RFC PATCH v2 7/8] xen: Add clang-format configuration


> On 2 Nov 2023, at 11:53, Jan Beulich <jbeulich@xxxxxxxx> wrote:
> 
> On 02.11.2023 12:41, Luca Fancellu wrote:
>>> On 2 Nov 2023, at 09:10, Jan Beulich <jbeulich@xxxxxxxx> wrote:
>>> On 31.10.2023 14:23, Luca Fancellu wrote:
>>>> Add a clang format configuration for the Xen Hypervisor.
>>>> 
>>>> Signed-off-by: Luca Fancellu <luca.fancellu@xxxxxxx>
>>>> ---
>>>> xen/.clang-format | 693 ++++++++++++++++++++++++++++++++++++++++++++++
>>>> 1 file changed, 693 insertions(+)
>>>> create mode 100644 xen/.clang-format
>>> 
>>> I think this needs splitting and every setting then individually correlating
>>> with what we have in ./CODING_STYLE. That would entail extending 
>>> ./CODING_STYLE
>>> by anything not presently written down, but intended to be checked for.
>> 
>> Do you mean introducing one parameter for each patch with the corresponding 
>> entry in
>> CODING_STYLE?
>> 
>> It would make sense, however there are 116 parameters, from those I think at 
>> least 56 needs
>> to have a corresponding entry in CODING_STYLE (maybe in the end they will be 
>> less, but I don’t expect
>> them to be less than 40), so given the amount of patches, I’m afraid to 
>> flood the mailing list.
> 
> Some grouping may certainly make sense, for related settings. What I'm
> completely lost with the present submission is which of the settings
> merely enforce existing content of ./CODING_STYLE, and which ones
> (silently) impose new rules which everyone may agree with, but also may
> not.

I will start a separate thread, referring to this serie, with all the 
maintainers and I will
push a number of parameters at the time, starting from the one that already 
enforces the
content of the coding style, with explanation for them.

> 
>> I was thinking we could discuss them in chunks and update the serie during 
>> time, we could put in this
>> patch also the update to the CODING_STYLE file. Something like the MISRA 
>> rule acceptance, what
>> do you think? Shall we do the discussion by ML or by meetings? Every time I 
>> could bring up a number
>> of parameters and update the serie when the discussion on them is finished.
> 
> Afaic - email if at all possible. The more that, considering past
> attempts to extend ./CODING_STYLE, for some items it may be close to
> impossible to reach agreement.
> 
>> This is my breakdown:
>> 
>> 116 total configurables
>> 
>> ================================================================================
>> 13 straightforward
> 
> What exactly do you qualify as such?
> 
>> AttributeMacros:
>>  -[...]
>> 
>> ColumnLimit: 80
>> 
>> IndentWidth: 4
>> 
>> Language: Cpp
>> 
>> MacroBlockBegin: '^PLATFORM_START|^DT_DEVICE_START|^ACPI_DEVICE_START'
>> 
>> MacroBlockEnd: '^PLATFORM_END|^DT_DEVICE_END|^ACPI_DEVICE_END'
> 
> Without explanation it is, for example, not clear to me what these two
> settings are about. Which includes me not understanding why these
> identifiers are (apparently) special in some specific way.
> 
>> Standard: C++03
> 
> I don't consider this "straightforward" at all. Only C99 could be deemed
> straightforward here, imo.

Sure, I will start from the “straightforward” which I mean the one that I think 
are less controversial,
for example here I know well that we use C99, but clang-format was not really 
meant for C, it’s more
Cpp oriented, however C++03 is the value used by Linux so I guess it can be 
fine also for us.

Anyway as I said, I can start another thread with a few parameters that we can 
analyze each time.

> 
>> ================================================================================
>> 10 don't really need a discussion
>> 
>> PenaltyBreakAssignment: 30
>> 
>> PenaltyBreakBeforeFirstCallParameter: 30
>> 
>> PenaltyBreakComment: 10
>> 
>> PenaltyBreakFirstLessLess: 0
>> 
>> PenaltyBreakOpenParenthesis: 100
>> 
>> PenaltyBreakString: 10
>> 
>> PenaltyExcessCharacter: 100
>> 
>> PenaltyIndentedWhitespace: 0
>> 
>> PenaltyReturnTypeOnItsOwnLine: 60
>> 
>> CommentPragmas: '^ IWYU pragma:'
> 
> Like with the "straightforward" ones above, without knowing what these
> affect (or whether some simply don't affect us at all, and hence could
> be set to any value) I can't follow the "don't really need a discussion"
> qualification.

So here I meant that these parameters are only tuning the algorithm, so their 
value
is not something enforcing a rule, so they are in some way “bending” some of 
them
but their effect is visible mostly in conjunction with the overall computation 
of every rule.

But of course we are going to discuss also them, it’s just that I don’t feel 
there might be
disagreements on them.

> 
> Jan


 


Rackspace

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