Message ID | 20210222032915.31452-1-laurent.pinchart@ideasonboard.com |
---|---|
State | Accepted |
Headers | show |
Series |
|
Related | show |
Hi Laurent, On 22/02/2021 03:29, Laurent Pinchart wrote: > Add all options available in the new version that were previously > commented out (or just not listed). The commented out value is replaced > by the clang-format-7 default where they differ, to avoid changing the > current behaviour. > I think upgrading to v7 is worthwhile now ;-) I seem to be running version 10 - so 4 ... must be quite old by now. Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > --- > .clang-format | 43 +++++++++++++++++++++++-------------------- > 1 file changed, 23 insertions(+), 20 deletions(-) > > diff --git a/.clang-format b/.clang-format > index bef07cd84338..c561a8d9245b 100644 > --- a/.clang-format > +++ b/.clang-format > @@ -1,6 +1,6 @@ > # SPDX-License-Identifier: GPL-2.0-only > # > -# clang-format configuration file. Intended for clang-format >= 4. > +# clang-format configuration file. Intended for clang-format >= 7. > # > # For more information, see: > # > @@ -9,11 +9,12 @@ > # https://clang.llvm.org/docs/ClangFormatStyleOptions.html > # > --- > +Language: Cpp > AccessModifierOffset: -8 > AlignAfterOpenBracket: Align > AlignConsecutiveAssignments: false > AlignConsecutiveDeclarations: false > -#AlignEscapedNewlines: Left # Unknown to clang-format-4.0 > +AlignEscapedNewlines: Right > AlignOperands: true > AlignTrailingComments: false > AllowAllParametersOfDeclarationOnNextLine: false > @@ -25,7 +26,7 @@ AllowShortLoopsOnASingleLine: false > AlwaysBreakAfterDefinitionReturnType: None > AlwaysBreakAfterReturnType: None > AlwaysBreakBeforeMultilineStrings: false > -AlwaysBreakTemplateDeclarations: false > +AlwaysBreakTemplateDeclarations: MultiLine > BinPackArguments: true > BinPackParameters: true > BraceWrapping: > @@ -37,24 +38,24 @@ BraceWrapping: > AfterObjCDeclaration: false > AfterStruct: false > AfterUnion: false > - #AfterExternBlock: false # Unknown to clang-format-5.0 > + AfterExternBlock: false > BeforeCatch: false > BeforeElse: false > IndentBraces: false > - #SplitEmptyFunction: true # Unknown to clang-format-4.0 > - #SplitEmptyRecord: true # Unknown to clang-format-4.0 > - #SplitEmptyNamespace: true # Unknown to clang-format-4.0 > + SplitEmptyFunction: true > + SplitEmptyRecord: true > + SplitEmptyNamespace: true > BreakBeforeBinaryOperators: None > BreakBeforeBraces: Custom > -#BreakBeforeInheritanceComma: false # Unknown to clang-format-4.0 > +BreakBeforeInheritanceComma: false > +BreakInheritanceList: BeforeColon > BreakBeforeTernaryOperators: true > -BreakConstructorInitializersBeforeComma: false > -#BreakConstructorInitializers: BeforeComma # Unknown to clang-format-4.0 > +BreakConstructorInitializers: BeforeColon > BreakAfterJavaFieldAnnotations: false > BreakStringLiterals: false > ColumnLimit: 0 > CommentPragmas: '^ IWYU pragma:' > -#CompactNamespaces: false # Unknown to clang-format-4.0 > +CompactNamespaces: false > ConstructorInitializerAllOnOneLineOrOnePerLine: false > ConstructorInitializerIndentWidth: 8 > ContinuationIndentWidth: 8 > @@ -62,16 +63,16 @@ Cpp11BracedListStyle: false > DerivePointerAlignment: false > DisableFormat: false > ExperimentalAutoDetectBinPacking: false > -#FixNamespaceComments: false # Unknown to clang-format-4.0 > +FixNamespaceComments: true > ForEachMacros: > - 'udev_list_entry_foreach' > -#IncludeBlocks: Preserve # Unknown to clang-format-5.0 > +IncludeBlocks: Preserve > IncludeCategories: > - Regex: '.*' > Priority: 1 > IncludeIsMainRegex: '(_test)?$' > IndentCaseLabels: false > -#IndentPPDirectives: None # Unknown to clang-format-5.0 > +IndentPPDirectives: None > IndentWidth: 8 > IndentWrappedFunctionNames: false > JavaScriptQuotes: Leave > @@ -81,31 +82,33 @@ MacroBlockBegin: '' > MacroBlockEnd: '' > MaxEmptyLinesToKeep: 1 > NamespaceIndentation: None > -#ObjCBinPackProtocolList: Auto # Unknown to clang-format-5.0 > +ObjCBinPackProtocolList: Auto > ObjCBlockIndentWidth: 8 > ObjCSpaceAfterProperty: true > ObjCSpaceBeforeProtocolList: true > > # Taken from git's rules > -#PenaltyBreakAssignment: 10 # Unknown to clang-format-4.0 > +PenaltyBreakAssignment: 10 > PenaltyBreakBeforeFirstCallParameter: 30 > PenaltyBreakComment: 10 > PenaltyBreakFirstLessLess: 0 > PenaltyBreakString: 10 > +PenaltyBreakTemplateDeclaration: 10 > PenaltyExcessCharacter: 100 > PenaltyReturnTypeOnItsOwnLine: 60 > > PointerAlignment: Right > ReflowComments: false > SortIncludes: false > -#SortUsingDeclarations: false # Unknown to clang-format-4.0 > +SortUsingDeclarations: true > SpaceAfterCStyleCast: false > SpaceAfterTemplateKeyword: false > SpaceBeforeAssignmentOperators: true > -#SpaceBeforeCtorInitializerColon: true # Unknown to clang-format-5.0 > -#SpaceBeforeInheritanceColon: true # Unknown to clang-format-5.0 > +SpaceBeforeCpp11BracedList: false > +SpaceBeforeCtorInitializerColon: true > +SpaceBeforeInheritanceColon: true > SpaceBeforeParens: ControlStatements > -#SpaceBeforeRangeBasedForLoopColon: true # Unknown to clang-format-5.0 > +SpaceBeforeRangeBasedForLoopColon: true > SpaceInEmptyParentheses: false > SpacesBeforeTrailingComments: 1 > SpacesInAngles: false >
diff --git a/.clang-format b/.clang-format index bef07cd84338..c561a8d9245b 100644 --- a/.clang-format +++ b/.clang-format @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only # -# clang-format configuration file. Intended for clang-format >= 4. +# clang-format configuration file. Intended for clang-format >= 7. # # For more information, see: # @@ -9,11 +9,12 @@ # https://clang.llvm.org/docs/ClangFormatStyleOptions.html # --- +Language: Cpp AccessModifierOffset: -8 AlignAfterOpenBracket: Align AlignConsecutiveAssignments: false AlignConsecutiveDeclarations: false -#AlignEscapedNewlines: Left # Unknown to clang-format-4.0 +AlignEscapedNewlines: Right AlignOperands: true AlignTrailingComments: false AllowAllParametersOfDeclarationOnNextLine: false @@ -25,7 +26,7 @@ AllowShortLoopsOnASingleLine: false AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterReturnType: None AlwaysBreakBeforeMultilineStrings: false -AlwaysBreakTemplateDeclarations: false +AlwaysBreakTemplateDeclarations: MultiLine BinPackArguments: true BinPackParameters: true BraceWrapping: @@ -37,24 +38,24 @@ BraceWrapping: AfterObjCDeclaration: false AfterStruct: false AfterUnion: false - #AfterExternBlock: false # Unknown to clang-format-5.0 + AfterExternBlock: false BeforeCatch: false BeforeElse: false IndentBraces: false - #SplitEmptyFunction: true # Unknown to clang-format-4.0 - #SplitEmptyRecord: true # Unknown to clang-format-4.0 - #SplitEmptyNamespace: true # Unknown to clang-format-4.0 + SplitEmptyFunction: true + SplitEmptyRecord: true + SplitEmptyNamespace: true BreakBeforeBinaryOperators: None BreakBeforeBraces: Custom -#BreakBeforeInheritanceComma: false # Unknown to clang-format-4.0 +BreakBeforeInheritanceComma: false +BreakInheritanceList: BeforeColon BreakBeforeTernaryOperators: true -BreakConstructorInitializersBeforeComma: false -#BreakConstructorInitializers: BeforeComma # Unknown to clang-format-4.0 +BreakConstructorInitializers: BeforeColon BreakAfterJavaFieldAnnotations: false BreakStringLiterals: false ColumnLimit: 0 CommentPragmas: '^ IWYU pragma:' -#CompactNamespaces: false # Unknown to clang-format-4.0 +CompactNamespaces: false ConstructorInitializerAllOnOneLineOrOnePerLine: false ConstructorInitializerIndentWidth: 8 ContinuationIndentWidth: 8 @@ -62,16 +63,16 @@ Cpp11BracedListStyle: false DerivePointerAlignment: false DisableFormat: false ExperimentalAutoDetectBinPacking: false -#FixNamespaceComments: false # Unknown to clang-format-4.0 +FixNamespaceComments: true ForEachMacros: - 'udev_list_entry_foreach' -#IncludeBlocks: Preserve # Unknown to clang-format-5.0 +IncludeBlocks: Preserve IncludeCategories: - Regex: '.*' Priority: 1 IncludeIsMainRegex: '(_test)?$' IndentCaseLabels: false -#IndentPPDirectives: None # Unknown to clang-format-5.0 +IndentPPDirectives: None IndentWidth: 8 IndentWrappedFunctionNames: false JavaScriptQuotes: Leave @@ -81,31 +82,33 @@ MacroBlockBegin: '' MacroBlockEnd: '' MaxEmptyLinesToKeep: 1 NamespaceIndentation: None -#ObjCBinPackProtocolList: Auto # Unknown to clang-format-5.0 +ObjCBinPackProtocolList: Auto ObjCBlockIndentWidth: 8 ObjCSpaceAfterProperty: true ObjCSpaceBeforeProtocolList: true # Taken from git's rules -#PenaltyBreakAssignment: 10 # Unknown to clang-format-4.0 +PenaltyBreakAssignment: 10 PenaltyBreakBeforeFirstCallParameter: 30 PenaltyBreakComment: 10 PenaltyBreakFirstLessLess: 0 PenaltyBreakString: 10 +PenaltyBreakTemplateDeclaration: 10 PenaltyExcessCharacter: 100 PenaltyReturnTypeOnItsOwnLine: 60 PointerAlignment: Right ReflowComments: false SortIncludes: false -#SortUsingDeclarations: false # Unknown to clang-format-4.0 +SortUsingDeclarations: true SpaceAfterCStyleCast: false SpaceAfterTemplateKeyword: false SpaceBeforeAssignmentOperators: true -#SpaceBeforeCtorInitializerColon: true # Unknown to clang-format-5.0 -#SpaceBeforeInheritanceColon: true # Unknown to clang-format-5.0 +SpaceBeforeCpp11BracedList: false +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true SpaceBeforeParens: ControlStatements -#SpaceBeforeRangeBasedForLoopColon: true # Unknown to clang-format-5.0 +SpaceBeforeRangeBasedForLoopColon: true SpaceInEmptyParentheses: false SpacesBeforeTrailingComments: 1 SpacesInAngles: false
Add all options available in the new version that were previously commented out (or just not listed). The commented out value is replaced by the clang-format-7 default where they differ, to avoid changing the current behaviour. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> --- .clang-format | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-)