En-Shuo Hsu | c7a8c57 | 2019-04-10 10:15:27 +0800 | [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 |
| 55 | ColumnLimit: 80 |
| 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: |
En-Shuo Hsu | f03b924 | 2019-04-23 15:52:36 +0800 | [diff] [blame] | 68 | # git grep -h '^#define [^[:space:]]*FOREACH[^[:space:]]*(' cras/ \ |
| 69 | # | sed "s,^#define \([^[:space:]]*FOREACH[^[:space:]]*\)(.*$, - '\1'," \ |
En-Shuo Hsu | c7a8c57 | 2019-04-10 10:15:27 +0800 | [diff] [blame] | 70 | # | sort | uniq |
| 71 | ForEachMacros: |
En-Shuo Hsu | 2c81943 | 2019-05-25 16:56:20 +0800 | [diff] [blame] | 72 | - 'ARRAY_ELEMENT_FOREACH' |
En-Shuo Hsu | f03b924 | 2019-04-23 15:52:36 +0800 | [diff] [blame] | 73 | - 'DL_FOREACH' |
| 74 | - 'DL_FOREACH_INTERNAL' |
| 75 | - 'LL_FOREACH' |
| 76 | - 'LL_FOREACH_SAFE' |
En-Shuo Hsu | c7a8c57 | 2019-04-10 10:15:27 +0800 | [diff] [blame] | 77 | |
| 78 | #IncludeBlocks: Preserve # Unknown to clang-format-5.0 |
| 79 | IncludeCategories: |
| 80 | - Regex: '.*' |
| 81 | Priority: 1 |
| 82 | IncludeIsMainRegex: '(Test)?$' |
| 83 | IndentCaseLabels: false |
| 84 | #IndentPPDirectives: None # Unknown to clang-format-5.0 |
| 85 | IndentWidth: 8 |
| 86 | IndentWrappedFunctionNames: false |
| 87 | JavaScriptQuotes: Leave |
| 88 | JavaScriptWrapImports: true |
| 89 | KeepEmptyLinesAtTheStartOfBlocks: false |
| 90 | MacroBlockBegin: '' |
| 91 | MacroBlockEnd: '' |
| 92 | MaxEmptyLinesToKeep: 1 |
| 93 | NamespaceIndentation: Inner |
| 94 | #ObjCBinPackProtocolList: Auto # Unknown to clang-format-5.0 |
| 95 | ObjCBlockIndentWidth: 8 |
| 96 | ObjCSpaceAfterProperty: true |
| 97 | ObjCSpaceBeforeProtocolList: true |
| 98 | |
| 99 | # Taken from git's rules |
| 100 | #PenaltyBreakAssignment: 10 # Unknown to clang-format-4.0 |
| 101 | PenaltyBreakBeforeFirstCallParameter: 30 |
| 102 | PenaltyBreakComment: 10 |
| 103 | PenaltyBreakFirstLessLess: 0 |
| 104 | PenaltyBreakString: 10 |
| 105 | PenaltyExcessCharacter: 100 |
| 106 | PenaltyReturnTypeOnItsOwnLine: 60 |
| 107 | |
| 108 | PointerAlignment: Right |
| 109 | ReflowComments: false |
| 110 | SortIncludes: false |
| 111 | #SortUsingDeclarations: false # Unknown to clang-format-4.0 |
| 112 | SpaceAfterCStyleCast: false |
| 113 | SpaceAfterTemplateKeyword: true |
| 114 | SpaceBeforeAssignmentOperators: true |
| 115 | #SpaceBeforeCtorInitializerColon: true # Unknown to clang-format-5.0 |
| 116 | #SpaceBeforeInheritanceColon: true # Unknown to clang-format-5.0 |
| 117 | SpaceBeforeParens: ControlStatements |
| 118 | #SpaceBeforeRangeBasedForLoopColon: true # Unknown to clang-format-5.0 |
| 119 | SpaceInEmptyParentheses: false |
| 120 | SpacesBeforeTrailingComments: 1 |
| 121 | SpacesInAngles: false |
| 122 | SpacesInContainerLiterals: false |
| 123 | SpacesInCStyleCastParentheses: false |
| 124 | SpacesInParentheses: false |
| 125 | SpacesInSquareBrackets: false |
| 126 | Standard: Cpp03 |
| 127 | TabWidth: 8 |
| 128 | UseTab: Always |
| 129 | ... |