1# SPDX-License-Identifier: GPL-2.0 2# 3# clang-format configuration file. Intended for clang-format >= 11. 4# 5# For more information, see: 6# 7# Documentation/process/clang-format.rst 8# https://clang.llvm.org/docs/ClangFormat.html 9# https://clang.llvm.org/docs/ClangFormatStyleOptions.html 10# 11--- 12AccessModifierOffset: -4 13AlignAfterOpenBracket: Align 14AlignConsecutiveAssignments: false 15AlignConsecutiveDeclarations: false 16AlignEscapedNewlines: Left 17AlignOperands: true 18AlignTrailingComments: false 19AllowAllParametersOfDeclarationOnNextLine: false 20AllowShortBlocksOnASingleLine: false 21AllowShortCaseLabelsOnASingleLine: false 22AllowShortFunctionsOnASingleLine: None 23AllowShortIfStatementsOnASingleLine: false 24AllowShortLoopsOnASingleLine: false 25AlwaysBreakAfterDefinitionReturnType: None 26AlwaysBreakAfterReturnType: None 27AlwaysBreakBeforeMultilineStrings: false 28AlwaysBreakTemplateDeclarations: false 29BinPackArguments: true 30BinPackParameters: true 31BraceWrapping: 32 AfterClass: false 33 AfterControlStatement: false 34 AfterEnum: false 35 AfterFunction: true 36 AfterNamespace: true 37 AfterObjCDeclaration: false 38 AfterStruct: false 39 AfterUnion: false 40 AfterExternBlock: false 41 BeforeCatch: false 42 BeforeElse: false 43 IndentBraces: false 44 SplitEmptyFunction: true 45 SplitEmptyRecord: true 46 SplitEmptyNamespace: true 47BreakBeforeBinaryOperators: None 48BreakBeforeBraces: Custom 49BreakBeforeInheritanceComma: false 50BreakBeforeTernaryOperators: false 51BreakConstructorInitializersBeforeComma: false 52BreakConstructorInitializers: BeforeComma 53BreakAfterJavaFieldAnnotations: false 54BreakStringLiterals: false 55ColumnLimit: 80 56CommentPragmas: '^ IWYU pragma:' 57CompactNamespaces: false 58ConstructorInitializerAllOnOneLineOrOnePerLine: false 59ConstructorInitializerIndentWidth: 8 60ContinuationIndentWidth: 8 61Cpp11BracedListStyle: false 62DerivePointerAlignment: false 63DisableFormat: false 64ExperimentalAutoDetectBinPacking: false 65FixNamespaceComments: false 66 67# Taken from: 68# git grep -h '^#define [^[:space:]]*for_each[^[:space:]]*(' include/ tools/ \ 69# | sed "s,^#define \([^[:space:]]*for_each[^[:space:]]*\)(.*$, - '\1'," \ 70# | LC_ALL=C sort -u 71ForEachMacros: 72 - 'list_for_each_safe' 73 - 'nl_list_for_each_entry' 74 - 'nl_list_for_each_entry_safe' 75 - 'nla_for_each_attr' 76 - 'nla_for_each_nested' 77 - 'nlmsg_for_each' 78 - 'nlmsg_for_each_attr' 79 - 'nlmsg_for_each_msg' 80 81IncludeBlocks: Preserve 82IncludeCategories: 83 - Regex: '.*' 84 Priority: 1 85IncludeIsMainRegex: '(Test)?$' 86IndentCaseLabels: false 87IndentGotoLabels: false 88IndentPPDirectives: None 89IndentWidth: 8 90IndentWrappedFunctionNames: false 91JavaScriptQuotes: Leave 92JavaScriptWrapImports: true 93KeepEmptyLinesAtTheStartOfBlocks: false 94MacroBlockBegin: '' 95MacroBlockEnd: '' 96MaxEmptyLinesToKeep: 1 97NamespaceIndentation: None 98ObjCBinPackProtocolList: Auto 99ObjCBlockIndentWidth: 8 100ObjCSpaceAfterProperty: true 101ObjCSpaceBeforeProtocolList: true 102 103# Taken from git's rules 104PenaltyBreakAssignment: 10 105PenaltyBreakBeforeFirstCallParameter: 30 106PenaltyBreakComment: 10 107PenaltyBreakFirstLessLess: 0 108PenaltyBreakString: 10 109PenaltyExcessCharacter: 100 110PenaltyReturnTypeOnItsOwnLine: 60 111 112PointerAlignment: Right 113ReflowComments: false 114SortIncludes: false 115SortUsingDeclarations: false 116SpaceAfterCStyleCast: false 117SpaceAfterTemplateKeyword: true 118SpaceBeforeAssignmentOperators: true 119SpaceBeforeCtorInitializerColon: true 120SpaceBeforeInheritanceColon: true 121SpaceBeforeParens: ControlStatementsExceptForEachMacros 122SpaceBeforeRangeBasedForLoopColon: true 123SpaceInEmptyParentheses: false 124SpacesBeforeTrailingComments: 1 125SpacesInAngles: false 126SpacesInContainerLiterals: false 127SpacesInCStyleCastParentheses: false 128SpacesInParentheses: false 129SpacesInSquareBrackets: false 130Standard: Cpp03 131TabWidth: 8 132UseTab: Always 133... 134