Brian Salomon | b4a24e5 | 2016-12-08 09:21:00 -0500 | [diff] [blame] | 1 | --- |
| 2 | # Typical usage is to apply this to the lines you've modified in a local |
| 3 | # change. Stage your changes with "git add" and then run: |
| 4 | # $ git clang-format |
| 5 | # You can optionally use the "--" file filter to restrict formatting to certain |
| 6 | # files or directories. The tool will display the list of files that were |
| 7 | # modified. These have been modified without being staged. You can review the |
| 8 | # modifications using "git diff". |
| 9 | # |
Brian Salomon | 2183142 | 2018-07-27 16:26:26 -0400 | [diff] [blame] | 10 | # IF YOU UPDATE THE CPP SECTION ALSO UPDATE THE OBJECTIVE-C SECTION. IF YOU |
| 11 | # KNOW HOW TO SHARE SETTINGS BETWEEN THE TWO YOU'RE A TRUE HERO. |
| 12 | |
Brian Salomon | b4a24e5 | 2016-12-08 09:21:00 -0500 | [diff] [blame] | 13 | Language: Cpp |
| 14 | # BasedOnStyle: Google |
| 15 | AccessModifierOffset: -4 |
| 16 | AlignAfterOpenBracket: Align |
Mike Klein | d6ab77a | 2019-03-21 08:18:24 -0500 | [diff] [blame] | 17 | AlignConsecutiveAssignments: false |
| 18 | AlignConsecutiveDeclarations: false |
Brian Salomon | b4a24e5 | 2016-12-08 09:21:00 -0500 | [diff] [blame] | 19 | AlignEscapedNewlinesLeft: true |
| 20 | AlignOperands: true |
| 21 | AlignTrailingComments: true |
Mike Klein | d6ab77a | 2019-03-21 08:18:24 -0500 | [diff] [blame] | 22 | AllowAllParametersOfDeclarationOnNextLine: true |
Brian Salomon | b4a24e5 | 2016-12-08 09:21:00 -0500 | [diff] [blame] | 23 | AllowShortBlocksOnASingleLine: false |
Mike Klein | d6ab77a | 2019-03-21 08:18:24 -0500 | [diff] [blame] | 24 | AllowShortCaseLabelsOnASingleLine: false |
Brian Salomon | b4a24e5 | 2016-12-08 09:21:00 -0500 | [diff] [blame] | 25 | AllowShortFunctionsOnASingleLine: All |
Mike Klein | d6ab77a | 2019-03-21 08:18:24 -0500 | [diff] [blame] | 26 | AllowShortIfStatementsOnASingleLine: true |
| 27 | AllowShortLoopsOnASingleLine: true |
Brian Salomon | b4a24e5 | 2016-12-08 09:21:00 -0500 | [diff] [blame] | 28 | AlwaysBreakAfterDefinitionReturnType: None |
| 29 | AlwaysBreakAfterReturnType: None |
| 30 | AlwaysBreakBeforeMultilineStrings: true |
Brian Salomon | 02cb969 | 2018-12-20 21:09:52 -0500 | [diff] [blame] | 31 | AlwaysBreakTemplateDeclarations: false |
Mike Klein | d6ab77a | 2019-03-21 08:18:24 -0500 | [diff] [blame] | 32 | BinPackArguments: true |
| 33 | BinPackParameters: true |
Brian Salomon | 2183142 | 2018-07-27 16:26:26 -0400 | [diff] [blame] | 34 | BraceWrapping: |
Brian Salomon | b4a24e5 | 2016-12-08 09:21:00 -0500 | [diff] [blame] | 35 | AfterClass: false |
| 36 | AfterControlStatement: false |
| 37 | AfterEnum: false |
| 38 | AfterFunction: false |
| 39 | AfterNamespace: false |
| 40 | AfterObjCDeclaration: false |
| 41 | AfterStruct: false |
| 42 | AfterUnion: false |
| 43 | BeforeCatch: false |
| 44 | BeforeElse: false |
| 45 | IndentBraces: false |
| 46 | BreakBeforeBinaryOperators: None |
| 47 | BreakBeforeBraces: Custom |
| 48 | BreakBeforeTernaryOperators: true |
| 49 | BreakConstructorInitializersBeforeComma: true |
| 50 | BreakAfterJavaFieldAnnotations: false |
| 51 | BreakStringLiterals: true |
| 52 | ColumnLimit: 100 |
| 53 | CommentPragmas: '^ IWYU pragma:' |
| 54 | ConstructorInitializerAllOnOneLineOrOnePerLine: true |
Brian Salomon | 544851b | 2016-12-14 09:17:55 -0500 | [diff] [blame] | 55 | ConstructorInitializerIndentWidth: 8 |
Brian Salomon | b4a24e5 | 2016-12-08 09:21:00 -0500 | [diff] [blame] | 56 | ContinuationIndentWidth: 8 |
| 57 | Cpp11BracedListStyle: true |
| 58 | DerivePointerAlignment: false |
| 59 | DisableFormat: false |
Mike Klein | d6ab77a | 2019-03-21 08:18:24 -0500 | [diff] [blame] | 60 | ExperimentalAutoDetectBinPacking: true |
Brian Salomon | b4a24e5 | 2016-12-08 09:21:00 -0500 | [diff] [blame] | 61 | ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] |
Brian Salomon | 2183142 | 2018-07-27 16:26:26 -0400 | [diff] [blame] | 62 | IncludeCategories: |
| 63 | - Regex: '^<.*\.h>' |
| 64 | Priority: 1 |
| 65 | - Regex: '^<.*' |
| 66 | Priority: 2 |
| 67 | - Regex: '.*' |
| 68 | Priority: 3 |
| 69 | IncludeIsMainRegex: '([-_](test|unittest))?$' |
| 70 | IndentCaseLabels: true |
| 71 | IndentWidth: 4 |
| 72 | IndentWrappedFunctionNames: false |
| 73 | JavaScriptQuotes: Leave |
| 74 | JavaScriptWrapImports: true |
| 75 | KeepEmptyLinesAtTheStartOfBlocks: false |
Brian Salomon | 2183142 | 2018-07-27 16:26:26 -0400 | [diff] [blame] | 76 | MaxEmptyLinesToKeep: 1 |
| 77 | NamespaceIndentation: None |
| 78 | ObjCBlockIndentWidth: 2 |
| 79 | ObjCSpaceAfterProperty: false |
| 80 | ObjCSpaceBeforeProtocolList: false |
| 81 | PenaltyBreakBeforeFirstCallParameter: 1 |
| 82 | PenaltyBreakComment: 300 |
| 83 | PenaltyBreakFirstLessLess: 120 |
| 84 | PenaltyBreakString: 1000 |
| 85 | PenaltyExcessCharacter: 1000000 |
| 86 | PenaltyReturnTypeOnItsOwnLine: 200 |
| 87 | PointerAlignment: Left |
| 88 | ReflowComments: true |
| 89 | SortIncludes: true |
| 90 | SpaceAfterCStyleCast: false |
| 91 | SpaceAfterTemplateKeyword: true |
| 92 | SpaceBeforeAssignmentOperators: true |
| 93 | SpaceBeforeParens: ControlStatements |
| 94 | SpaceInEmptyParentheses: false |
| 95 | SpacesBeforeTrailingComments: 2 |
| 96 | SpacesInAngles: false |
| 97 | SpacesInContainerLiterals: true |
| 98 | SpacesInCStyleCastParentheses: false |
| 99 | SpacesInParentheses: false |
| 100 | SpacesInSquareBrackets: false |
Mike Klein | d6ab77a | 2019-03-21 08:18:24 -0500 | [diff] [blame] | 101 | Standard: Auto |
Brian Salomon | 2183142 | 2018-07-27 16:26:26 -0400 | [diff] [blame] | 102 | TabWidth: 4 |
| 103 | UseTab: Never |
| 104 | --- |
| 105 | Language: ObjC |
| 106 | AccessModifierOffset: -4 |
| 107 | AlignAfterOpenBracket: Align |
Mike Klein | d6ab77a | 2019-03-21 08:18:24 -0500 | [diff] [blame] | 108 | AlignConsecutiveAssignments: false |
| 109 | AlignConsecutiveDeclarations: false |
Brian Salomon | 2183142 | 2018-07-27 16:26:26 -0400 | [diff] [blame] | 110 | AlignEscapedNewlinesLeft: true |
| 111 | AlignOperands: true |
| 112 | AlignTrailingComments: true |
Mike Klein | d6ab77a | 2019-03-21 08:18:24 -0500 | [diff] [blame] | 113 | AllowAllParametersOfDeclarationOnNextLine: true |
Brian Salomon | 2183142 | 2018-07-27 16:26:26 -0400 | [diff] [blame] | 114 | AllowShortBlocksOnASingleLine: false |
Mike Klein | d6ab77a | 2019-03-21 08:18:24 -0500 | [diff] [blame] | 115 | AllowShortCaseLabelsOnASingleLine: false |
Brian Salomon | 2183142 | 2018-07-27 16:26:26 -0400 | [diff] [blame] | 116 | AllowShortFunctionsOnASingleLine: All |
Mike Klein | d6ab77a | 2019-03-21 08:18:24 -0500 | [diff] [blame] | 117 | AllowShortIfStatementsOnASingleLine: true |
| 118 | AllowShortLoopsOnASingleLine: true |
Brian Salomon | 2183142 | 2018-07-27 16:26:26 -0400 | [diff] [blame] | 119 | AlwaysBreakAfterDefinitionReturnType: None |
| 120 | AlwaysBreakAfterReturnType: None |
| 121 | AlwaysBreakBeforeMultilineStrings: true |
Brian Salomon | 02cb969 | 2018-12-20 21:09:52 -0500 | [diff] [blame] | 122 | AlwaysBreakTemplateDeclarations: false |
Mike Klein | d6ab77a | 2019-03-21 08:18:24 -0500 | [diff] [blame] | 123 | BinPackArguments: true |
| 124 | BinPackParameters: true |
Brian Salomon | 2183142 | 2018-07-27 16:26:26 -0400 | [diff] [blame] | 125 | BraceWrapping: |
| 126 | AfterClass: false |
| 127 | AfterControlStatement: false |
| 128 | AfterEnum: false |
| 129 | AfterFunction: false |
| 130 | AfterNamespace: false |
| 131 | AfterObjCDeclaration: false |
| 132 | AfterStruct: false |
| 133 | AfterUnion: false |
| 134 | BeforeCatch: false |
| 135 | BeforeElse: false |
| 136 | IndentBraces: false |
| 137 | BreakBeforeBinaryOperators: None |
| 138 | BreakBeforeBraces: Custom |
| 139 | BreakBeforeTernaryOperators: true |
| 140 | BreakConstructorInitializersBeforeComma: true |
| 141 | BreakAfterJavaFieldAnnotations: false |
| 142 | BreakStringLiterals: true |
| 143 | ColumnLimit: 100 |
| 144 | CommentPragmas: '^ IWYU pragma:' |
| 145 | ConstructorInitializerAllOnOneLineOrOnePerLine: true |
| 146 | ConstructorInitializerIndentWidth: 8 |
| 147 | ContinuationIndentWidth: 8 |
| 148 | Cpp11BracedListStyle: true |
| 149 | DerivePointerAlignment: false |
| 150 | DisableFormat: false |
Mike Klein | d6ab77a | 2019-03-21 08:18:24 -0500 | [diff] [blame] | 151 | ExperimentalAutoDetectBinPacking: true |
Brian Salomon | 2183142 | 2018-07-27 16:26:26 -0400 | [diff] [blame] | 152 | ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] |
| 153 | IncludeCategories: |
Brian Salomon | b4a24e5 | 2016-12-08 09:21:00 -0500 | [diff] [blame] | 154 | - Regex: '^<.*\.h>' |
| 155 | Priority: 1 |
| 156 | - Regex: '^<.*' |
| 157 | Priority: 2 |
| 158 | - Regex: '.*' |
| 159 | Priority: 3 |
| 160 | IncludeIsMainRegex: '([-_](test|unittest))?$' |
| 161 | IndentCaseLabels: true |
| 162 | IndentWidth: 4 |
| 163 | IndentWrappedFunctionNames: false |
| 164 | JavaScriptQuotes: Leave |
| 165 | JavaScriptWrapImports: true |
| 166 | KeepEmptyLinesAtTheStartOfBlocks: false |
Brian Salomon | b4a24e5 | 2016-12-08 09:21:00 -0500 | [diff] [blame] | 167 | MaxEmptyLinesToKeep: 1 |
| 168 | NamespaceIndentation: None |
| 169 | ObjCBlockIndentWidth: 2 |
| 170 | ObjCSpaceAfterProperty: false |
| 171 | ObjCSpaceBeforeProtocolList: false |
| 172 | PenaltyBreakBeforeFirstCallParameter: 1 |
| 173 | PenaltyBreakComment: 300 |
| 174 | PenaltyBreakFirstLessLess: 120 |
| 175 | PenaltyBreakString: 1000 |
| 176 | PenaltyExcessCharacter: 1000000 |
| 177 | PenaltyReturnTypeOnItsOwnLine: 200 |
| 178 | PointerAlignment: Left |
| 179 | ReflowComments: true |
| 180 | SortIncludes: true |
| 181 | SpaceAfterCStyleCast: false |
| 182 | SpaceAfterTemplateKeyword: true |
| 183 | SpaceBeforeAssignmentOperators: true |
| 184 | SpaceBeforeParens: ControlStatements |
| 185 | SpaceInEmptyParentheses: false |
| 186 | SpacesBeforeTrailingComments: 2 |
| 187 | SpacesInAngles: false |
| 188 | SpacesInContainerLiterals: true |
| 189 | SpacesInCStyleCastParentheses: false |
| 190 | SpacesInParentheses: false |
| 191 | SpacesInSquareBrackets: false |
| 192 | Standard: Auto |
| 193 | TabWidth: 4 |
| 194 | UseTab: Never |
| 195 | ... |
Mike Klein | d6ab77a | 2019-03-21 08:18:24 -0500 | [diff] [blame] | 196 | |