[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 11:41:55 +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=/7NjX8SCkzfViTzn5JyNACGHWqFlHkV2txgZSx65WU8=; b=JwuWMOiCCdXmN9swHajNuUwwMaUX9TJ7c2+h+fdQPjBXpP27Vd8Ac525IL5Sh2Srj6P+oyWgX44ZzYmYz2ewwcfxpxUewsN1gH1wFIWKMBNe5XclD2lKfqlkG5oUVXRb+cTf9NHOakqH+t5jSXgdk5D/35xscfjxM+TyMqTFVJigZR8Bi+/1pI59TpSU55/dlGEfUvDU+JQ4sEv1mro0iLtwzilKn3qROC2afib8WvS1DNJeQC8EVjKAAPGKnd/i66Punt1tP0k538zDlcI6d5lr0S9nlXE9tr80y37gfubrSrtpGJiz2mOWh8udDrmtC5apYhOgpvcrBogiVLDA3A==
  • 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=/7NjX8SCkzfViTzn5JyNACGHWqFlHkV2txgZSx65WU8=; b=X0ONsZMvI8zJFyeWDyfbV3a9sF98My8CdZQkh+UGVb0qigDK6rXH4fHHHvQ8MuN1LzWleliZSL6MxnbmBSND6TIe0sA3AkWQiL1rOknjyXpMahqiBqCckPvxfXBiLhqb21Yf1Q5DNgGuohymb4hJdP0TFapTxi/ECLlzUfMI/S6Jb4yKPcF87TtJa6XHr+hf/0cn7zz3q6vVca6urtm/Gbu/8M2MlH8gnG77UnRAVVJkqvrmu6L7Hk8SgNdd8NiEvnVQMHCSurqhSfLn/pLWlFFb9xpVuTmrRJ/gV05q6w3twgeao47BTkCi3PR8iFrOMagG7uDR/8HdkSL4dys3IA==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=mXel+1hTGoFcN6kYzZKPyx6Q4jJ4Dk883BCssTGONAPxDtLfUGBSFuwis45iBMqoMEYm7BLgYRu4H2AF1X4ghLYLq1j1ca+TSRcZ6uil3puGYJwxpZCiApj4Q5cP3rcH2aePTBKZVt6H12+GEsI5bsRHCSPZqw7AI5sqTyW1S55zI8SfR9yATo8dcr1eT5aJjMbdk+VOR8dsXppMrTu+JBfxr26uHhOb40bE3NBUJyazrFG7Uf4VdBYnLg4pkJe9fZdB5YFxaLBtN8cONNkCoA/Xuh6JveO22RN62SjVW9t52EnlWgHlTLyERQeiJ+LdJjsDsF7XjqpKVklyZf7D9w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m9NgHnBfAKMHPNDIENnIL0vlxj0Tlb0UCmiS+A0L58ALEKR1Z3Ef/ta+JZOv+aXG/Lbq0b/iBVc6gkFjwzxjgbGBWlaV6eZqjDyui9JFfS2sm7VtGkno9bBYR2djRVj4iZQIBxtE3srSfafRH/fNjaVRC41kQ/XvjryD4AsWvmCbRcVFjU1J20ZjWMBejDKtCn/GmhWpmvc75KNARw0oKihKz0Q/KVvxH3yu7DX9vobBTm7B+bMTDc+BBBMOy/TATGmCqQSRBxl1+3zvf1Z806zoZxLAxPrx2PcvxLztbcUs4s8O4kTOkE97oPO1+rUMJK6VYdSpg4X7Cqq1dr/TuA==
  • 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 11:42:51 +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/7ZrBmwPcAgAAqKoA=
  • Thread-topic: [RFC PATCH v2 7/8] xen: Add clang-format configuration

Hi Jan,

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

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.



This is my breakdown:

116 total configurables

================================================================================
13 straightforward

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'

Standard: C++03

StatementMacros:
  - [...]

TabWidth: 4

TypenameMacros:
  - 'XEN_GUEST_HANDLE'
  - 'XEN_GUEST_HANDLE_64'
  - 'XEN_GUEST_HANDLE_PARAM'
  - 'ELF_HANDLE_DECL'

UseTab: Never

WhitespaceSensitiveMacros:
  - '__stringify'

================================================================================
56 that requires discussions

QualifierAlignment: Custom
QualifierOrder: ['static', 'inline', 'const', 'volatile', 'type']

AlignAfterOpenBracket: Align

AlignArrayOfStructures: Left

AlignConsecutiveAssignments:
  Enabled: false
  AcrossEmptyLines: false
  AcrossComments: false

AlignConsecutiveBitFields: None

AlignConsecutiveDeclarations: None

AlignConsecutiveMacros:
  Enabled: false
  AcrossEmptyLines: false
  AcrossComments: false

AlignEscapedNewlines: Right

AlignOperands: Align

AlignTrailingComments: false

AllowAllArgumentsOnNextLine: false

AllowAllParametersOfDeclarationOnNextLine: false

AllowShortBlocksOnASingleLine: Never

AllowShortCaseLabelsOnASingleLine: false

AllowShortFunctionsOnASingleLine: None

AllowShortIfStatementsOnASingleLine: Never

AllowShortLoopsOnASingleLine: false

AlwaysBreakAfterReturnType: None

AlwaysBreakBeforeMultilineStrings: false

BinPackArguments: true

BinPackParameters: true

BitFieldColonSpacing: None

BreakBeforeBraces: Custom
BraceWrapping:
  AfterCaseLabel: true
  AfterFunction: true
  BeforeElse: true
  AfterExternBlock: true
  AfterEnum: false
  AfterStruct: false
  AfterUnion: false
  AfterControlStatement: Always
  BeforeWhile: false
  IndentBraces: false
  SplitEmptyFunction: false
  AfterClass: false
  AfterNamespace: false
  AfterObjCDeclaration: false
  BeforeCatch: false
  BeforeLambdaBody: false
  SplitEmptyRecord: true
  SplitEmptyNamespace: true

BreakBeforeBinaryOperators: None

BreakBeforeTernaryOperators: true

BreakStringLiterals: false

IncludeBlocks: Preserve

IndentCaseBlocks: false

IndentCaseLabels: false

IndentGotoLabels: true

IndentPPDirectives: None

IndentWrappedFunctionNames: false

InsertBraces: false

KeepEmptyLinesAtTheStartOfBlocks: false

MaxEmptyLinesToKeep: 1

PointerAlignment: Right

PPIndentWidth: -1

ReflowComments: false

SeparateDefinitionBlocks: Always

SortIncludes: Never

SpaceAfterCStyleCast: false

SpaceAfterLogicalNot: false

SpaceAroundPointerQualifiers: After

SpaceBeforeAssignmentOperators: true

SpaceBeforeCaseColon: false

SpaceBeforeParens: ControlStatementsExceptForEachMacros

SpaceBeforeSquareBrackets: false

SpaceInEmptyParentheses: false

SpacesBeforeTrailingComments: 1

SpacesInConditionalStatement: true

SpacesInCStyleCastParentheses: false

SpaceInEmptyBlock: false

SpacesInLineCommentPrefix:
  Minimum: 1
  Maximum: -1

SpacesInParentheses: false

SpacesInSquareBrackets: false

================================================================================
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:'

================================================================================
37 non related to C language

AlwaysBreakTemplateDeclarations: false

BreakConstructorInitializers: BeforeComma

AccessModifierOffset: -4

AllowShortLambdasOnASingleLine: None

BreakAfterJavaFieldAnnotations: false

BreakBeforeConceptDeclarations: Never

BreakInheritanceList: BeforeColon

CompactNamespaces: false

ConstructorInitializerAllOnOneLineOrOnePerLine: false

ConstructorInitializerIndentWidth: 4

Cpp11BracedListStyle: false

EmptyLineAfterAccessModifier: Leave

EmptyLineBeforeAccessModifier: Leave

FixNamespaceComments: false

IndentAccessModifiers: false

IndentRequiresClause: false

InsertTrailingCommas: None

JavaScriptQuotes: Leave

JavaScriptWrapImports: true

NamespaceIndentation: None

ObjCBinPackProtocolList: Auto

ObjCBlockIndentWidth: 4

ObjCBreakBeforeNestedBlockParam: false

ObjCSpaceAfterProperty: true

ObjCSpaceBeforeProtocolList: true

PackConstructorInitializers: Never

PenaltyBreakTemplateDeclaration: 0

ReferenceAlignment: Right

SortUsingDeclarations: false

SpaceAfterTemplateKeyword: true

SpaceBeforeCpp11BracedList: false

SpaceBeforeCtorInitializerColon: false

SpaceBeforeInheritanceColon: true

SpacesInAngles: false

SpacesInContainerLiterals: false

SpaceBeforeRangeBasedForLoopColon: true

IndentExternBlock: NoIndent

> 
>> --- /dev/null
>> +++ b/xen/.clang-format
>> @@ -0,0 +1,693 @@
>> +# SPDX-License-Identifier: GPL-2.0-only
>> +#
>> +# clang-format configuration file. Intended for clang-format >= 15.
>> +#
>> +# For more information, see:
>> +#
>> +#   Documentation/process/clang-format.rst
>> +#   https://clang.llvm.org/docs/ClangFormat.html
>> +#   https://clang.llvm.org/docs/ClangFormatStyleOptions.html
> 
> ... pointing to further doc is helpful in general, but imo insufficient for
> the introduction of the various settings.

Yes I realise now that I’ve copied this from Linux and I should have dropped at 
least
the line Documentation/process/clang-format.rst and 
https://clang.llvm.org/docs/ClangFormat.html.
The line https://clang.llvm.org/docs/ClangFormatStyleOptions.html I think makes 
sense
because it’s a documentation to the clang-format parameter present in the file.

Thanks for your review.

Cheers,
Luca


 


Rackspace

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