Håkon Alseth | a88dc36 | 2018-10-04 14:21:59 +0200 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0 |
| 2 | # |
| 3 | # clang-format configuration file. Intended for clang-format >= 4. |
| 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 | --- |
| 12 | AccessModifierOffset: -4 |
| 13 | AlignAfterOpenBracket: Align |
| 14 | AlignConsecutiveAssignments: false |
| 15 | AlignConsecutiveDeclarations: false |
| 16 | #AlignEscapedNewlines: Left # Unknown to clang-format-4.0 |
| 17 | AlignOperands: true |
| 18 | AlignTrailingComments: false |
| 19 | AllowAllParametersOfDeclarationOnNextLine: false |
| 20 | AllowShortBlocksOnASingleLine: false |
| 21 | AllowShortCaseLabelsOnASingleLine: false |
| 22 | AllowShortFunctionsOnASingleLine: None |
| 23 | AllowShortIfStatementsOnASingleLine: false |
| 24 | AllowShortLoopsOnASingleLine: false |
| 25 | AlwaysBreakAfterDefinitionReturnType: None |
| 26 | AlwaysBreakAfterReturnType: None |
| 27 | AlwaysBreakBeforeMultilineStrings: false |
| 28 | AlwaysBreakTemplateDeclarations: false |
| 29 | BinPackArguments: true |
| 30 | BinPackParameters: true |
| 31 | BraceWrapping: |
| 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 # Unknown to clang-format-5.0 |
| 41 | BeforeCatch: false |
| 42 | BeforeElse: false |
| 43 | IndentBraces: false |
| 44 | #SplitEmptyFunction: true # Unknown to clang-format-4.0 |
| 45 | #SplitEmptyRecord: true # Unknown to clang-format-4.0 |
| 46 | #SplitEmptyNamespace: true # Unknown to clang-format-4.0 |
| 47 | BreakBeforeBinaryOperators: None |
| 48 | BreakBeforeBraces: Custom |
| 49 | #BreakBeforeInheritanceComma: false # Unknown to clang-format-4.0 |
| 50 | BreakBeforeTernaryOperators: false |
| 51 | BreakConstructorInitializersBeforeComma: false |
| 52 | #BreakConstructorInitializers: BeforeComma # Unknown to clang-format-4.0 |
| 53 | BreakAfterJavaFieldAnnotations: false |
| 54 | BreakStringLiterals: false |
Piotr Pryga | 6432a56 | 2021-05-06 09:52:36 +0200 | [diff] [blame] | 55 | ColumnLimit: 100 |
Håkon Alseth | a88dc36 | 2018-10-04 14:21:59 +0200 | [diff] [blame] | 56 | CommentPragmas: '^ IWYU pragma:' |
| 57 | #CompactNamespaces: false # Unknown to clang-format-4.0 |
| 58 | ConstructorInitializerAllOnOneLineOrOnePerLine: false |
| 59 | ConstructorInitializerIndentWidth: 8 |
| 60 | ContinuationIndentWidth: 8 |
| 61 | Cpp11BracedListStyle: false |
| 62 | DerivePointerAlignment: false |
| 63 | DisableFormat: false |
| 64 | ExperimentalAutoDetectBinPacking: false |
| 65 | #FixNamespaceComments: false # Unknown to clang-format-4.0 |
| 66 | |
| 67 | # Taken from: |
Peter Bigot | 1ec9d2a | 2020-03-26 11:34:58 -0500 | [diff] [blame] | 68 | # git grep -h '^#define [^[:space:]]*FOR_EACH[^[:space:]]*(' include/ \ |
| 69 | # | sed "s,^#define \([^[:space:]]*FOR_EACH[^[:space:]]*\)(.*$, - '\1'," \ |
Håkon Alseth | a88dc36 | 2018-10-04 14:21:59 +0200 | [diff] [blame] | 70 | # | sort | uniq |
| 71 | ForEachMacros: |
| 72 | - 'FOR_EACH' |
Peter Bigot | 1ec9d2a | 2020-03-26 11:34:58 -0500 | [diff] [blame] | 73 | - 'FOR_EACH_FIXED_ARG' |
Håkon Alseth | a88dc36 | 2018-10-04 14:21:59 +0200 | [diff] [blame] | 74 | - 'RB_FOR_EACH' |
| 75 | - 'RB_FOR_EACH_CONTAINER' |
| 76 | - 'SYS_DLIST_FOR_EACH_CONTAINER' |
| 77 | - 'SYS_DLIST_FOR_EACH_CONTAINER_SAFE' |
| 78 | - 'SYS_DLIST_FOR_EACH_NODE' |
| 79 | - 'SYS_DLIST_FOR_EACH_NODE_SAFE' |
| 80 | - 'SYS_SFLIST_FOR_EACH_CONTAINER' |
| 81 | - 'SYS_SFLIST_FOR_EACH_CONTAINER_SAFE' |
| 82 | - 'SYS_SFLIST_FOR_EACH_NODE' |
| 83 | - 'SYS_SFLIST_FOR_EACH_NODE_SAFE' |
| 84 | - 'SYS_SLIST_FOR_EACH_CONTAINER' |
| 85 | - 'SYS_SLIST_FOR_EACH_CONTAINER_SAFE' |
| 86 | - 'SYS_SLIST_FOR_EACH_NODE' |
| 87 | - 'SYS_SLIST_FOR_EACH_NODE_SAFE' |
Håkon Alseth | a88dc36 | 2018-10-04 14:21:59 +0200 | [diff] [blame] | 88 | - 'Z_GENLIST_FOR_EACH_CONTAINER' |
| 89 | - 'Z_GENLIST_FOR_EACH_CONTAINER_SAFE' |
| 90 | - 'Z_GENLIST_FOR_EACH_NODE' |
| 91 | - 'Z_GENLIST_FOR_EACH_NODE_SAFE' |
Peter Bigot | 1ec9d2a | 2020-03-26 11:34:58 -0500 | [diff] [blame] | 92 | - '_WAIT_Q_FOR_EACH' |
Håkon Alseth | a88dc36 | 2018-10-04 14:21:59 +0200 | [diff] [blame] | 93 | |
| 94 | #IncludeBlocks: Preserve # Unknown to clang-format-5.0 |
| 95 | IncludeCategories: |
| 96 | - Regex: '.*' |
| 97 | Priority: 1 |
| 98 | IncludeIsMainRegex: '(Test)?$' |
| 99 | IndentCaseLabels: false |
| 100 | #IndentPPDirectives: None # Unknown to clang-format-5.0 |
| 101 | IndentWidth: 8 |
| 102 | IndentWrappedFunctionNames: false |
| 103 | JavaScriptQuotes: Leave |
| 104 | JavaScriptWrapImports: true |
| 105 | KeepEmptyLinesAtTheStartOfBlocks: false |
| 106 | MacroBlockBegin: '' |
| 107 | MacroBlockEnd: '' |
| 108 | MaxEmptyLinesToKeep: 1 |
| 109 | NamespaceIndentation: Inner |
| 110 | #ObjCBinPackProtocolList: Auto # Unknown to clang-format-5.0 |
| 111 | ObjCBlockIndentWidth: 8 |
| 112 | ObjCSpaceAfterProperty: true |
| 113 | ObjCSpaceBeforeProtocolList: true |
| 114 | |
| 115 | # Taken from git's rules |
| 116 | #PenaltyBreakAssignment: 10 # Unknown to clang-format-4.0 |
| 117 | PenaltyBreakBeforeFirstCallParameter: 30 |
| 118 | PenaltyBreakComment: 10 |
| 119 | PenaltyBreakFirstLessLess: 0 |
| 120 | PenaltyBreakString: 10 |
| 121 | PenaltyExcessCharacter: 100 |
| 122 | PenaltyReturnTypeOnItsOwnLine: 60 |
| 123 | |
| 124 | PointerAlignment: Right |
| 125 | ReflowComments: false |
| 126 | SortIncludes: false |
| 127 | #SortUsingDeclarations: false # Unknown to clang-format-4.0 |
| 128 | SpaceAfterCStyleCast: false |
| 129 | SpaceAfterTemplateKeyword: true |
| 130 | SpaceBeforeAssignmentOperators: true |
| 131 | #SpaceBeforeCtorInitializerColon: true # Unknown to clang-format-5.0 |
| 132 | #SpaceBeforeInheritanceColon: true # Unknown to clang-format-5.0 |
| 133 | SpaceBeforeParens: ControlStatements |
| 134 | #SpaceBeforeRangeBasedForLoopColon: true # Unknown to clang-format-5.0 |
| 135 | SpaceInEmptyParentheses: false |
| 136 | SpacesBeforeTrailingComments: 1 |
| 137 | SpacesInAngles: false |
| 138 | SpacesInContainerLiterals: false |
| 139 | SpacesInCStyleCastParentheses: false |
| 140 | SpacesInParentheses: false |
| 141 | SpacesInSquareBrackets: false |
| 142 | Standard: Cpp03 |
| 143 | TabWidth: 8 |
| 144 | UseTab: Always |
| 145 | ... |