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

Re: Clang-format configuration discussion - pt 2


  • To: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 27 Nov 2023 16:55:37 +0100
  • 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=W+GUzqXZnN9KgWDZbFfw0QSufZRF5F6NsWh/ypV0kGk=; b=U8mACLYR0MuSIpHM7ByCg4D64kSB4FPn5DSesUSESt3qhBRWUfSlqSvvhdqdXjpbzEVrzEFOG0Czj7nNG6OCCsRpiTkckMOlqEjz3NaGNeO3IepxyjCm4UjyH13iPHPmn3Sl9T3cQCfk5/ayRkqUAGJ/+F5U2d85V3WjrnVgEHb3N+GTKojktkv11WLEkvAhrWyvTijZbXrrb8rTpYKxvJYNUcW7Z245etiiRWCFCZLq1XJmSKcBKJY2kevZhdKvcqRDg55Mf4V32eYumW4tkYXEO+XCnTe9iue5GRlaqmBVAFLwk2oLLIKBZdSzwNogVzHRKfZ0Z66xOkVz9PFMbQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NHrySxGXN9IIMq5H9lFV2rNTvNWPZJL/fVIiZAo6iK6IFIeVNlsjEprbNApPa36NNT2zsWDRerXlhg6i5kIYulJcj39gyjcEcaTaobOGRgaJ7/XYiPcclLkfQo0dDBZFfqAOYF+6HClLkKXEF3N6DpTFJQ+yM6L0YGgxQSGWZCZBrcGtWX/K0F37jZOr46GULYRR07KX0zmlJUpg1GgqjNdURZDqiPtzCJ1NYl/5esvRpJpa1+vnKSApIVvXn4QPa/TPtdXf8jO7v22dL7WazvFnOpnvGQLwyEmGUfb6ZRku/1/Z28xUjq0ggWnM9xGGZVkX8A4a0/SjsDL6l8674A==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Autocrypt: addr=jbeulich@xxxxxxxx; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL
  • Cc: 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>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 27 Nov 2023 15:56:02 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 27.11.2023 16:37, Luca Fancellu wrote:
> 
> 
>> On 27 Nov 2023, at 15:13, Jan Beulich <jbeulich@xxxxxxxx> wrote:
>>
>> On 27.11.2023 15:58, Luca Fancellu wrote:
>>>> On 27 Nov 2023, at 12:20, Jan Beulich <jbeulich@xxxxxxxx> wrote:
>>>> On 24.11.2023 15:52, Luca Fancellu wrote:
>>>>>> On 24 Nov 2023, at 12:47, Jan Beulich <jbeulich@xxxxxxxx> wrote:
>>>>>> On 23.11.2023 15:47, Luca Fancellu wrote:
>>>>>>> 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
>>>>>>>
>>>>>>> --------------------------------------------------------------------------------------------------------------------------------------------------
>>>>>>>
>>>>>>> Our coding style doesn’t mention anything about alignment, shall we add 
>>>>>>> a new section?
>>>>>>> I can send patches when we reach agreement on each of these rules.
>>>>>>>
>>>>>>>
>>>>>>> QualifierAlignment: Custom
>>>>>>> QualifierOrder: ['static', 'inline', 'const', 'volatile', 'type']
>>>>>>>
>>>>>>> ---
>>>>>>> For “QualifierAlignment” I chose Custom in order to apply in 
>>>>>>> “QualifierOrder” an order for the
>>>>>>> qualifiers that match the current codebase, we could specify also 
>>>>>>> “Leave” in order to keep
>>>>>>> them as they are.
>>>>>>
>>>>>> Where do attributes go in this sequence?
>>>>>
>>>>> I think function declaration/definition and variables.
>>>>
>>>> How does this relate to my question? I asked about the sequence of elements
>>>> listed for QualifierOrder:, where attributes don't appear at all right now.
>>>
>>> Sorry, I misread your question, attributes are like invisible for the tool, 
>>> they can be placed wherever between
>>> each of the QualifierOrder items.
>>
>> Hoho, one thing where various options are tolerated.
>>
>>>>>>> --------------------------------------------------------------------------------------------------------------------------------------------------
>>>>>>>
>>>>>>> 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);
>>>>>>
>>>>>> The above matches neither of the two generally permitted styles:
>>>>>>
>>>>>>  someLongFunction(argument1,
>>>>>>                   argument2);
>>>>>>
>>>>>>  someLongFunction(
>>>>>>      argument1,
>>>>>>      argument2);
>>>>>>
>>>>>> Then again from its name I would infer this isn't just about function
>>>>>> arguments?
>>>>>
>>>>> I think it applies to parameters and arguments of functions and macro, 
>>>>> given the description in the docs.
>>>>>
>>>>> I see your two snippets above but I’ve always found at least on arm a 
>>>>> predominance of
>>>>> the style above for functions, so arguments aligned after the opening 
>>>>> bracket, for macros
>>>>> there is a mix.
>>>>
>>>> The latter "above" refers to which form exactly? The one you originally
>>>> spelled out, or the former of what my reply had?
>>>
>>> In my reply I was referring to the one I originally spelled out.
>>
>> But that's properly malformed, for not aligning argument2 with argument1.
>> Where are such constructs commonly used? I just took one example 
>> (cpuerrata.c)
>> and only found my first form of wrapping.
> 
> I had to go back to the thread to realise there was some style issue, the 
> snippet I thought
> I sent already had argument2 aligned under argument1, like this:
> 
> e.g.:
> someLongFunction(argument1,
>                                 argument2);
> 
> Even my wording was not really accurate, as I meant:
> “This one is to align function parameters that overflows the line length, I 
> chose to align them
> *after* the open bracket to match the current codebase (hopefully)”
> 
> So to summarize, this value formats the code to have overflowing args/param 
> aligned after
> the open braket.

But the example above _again_ does not have the two arguments aligned.
I would have suspected a mail UI issue, but
https://lists.xen.org/archives/html/xen-devel/2023-11/msg02366.html
similarly shows way too many indenting blanks on the 2nd line.

Jan



 


Rackspace

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