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