xref: /aosp_15_r20/external/skia/.clang-format (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
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
24Language:        Cpp
25# BasedOnStyle:  Google
26AccessModifierOffset: -4
27AlignAfterOpenBracket: Align
28AlignConsecutiveAssignments: false
29AlignConsecutiveDeclarations: false
30AlignEscapedNewlinesLeft: true
31AlignOperands:   true
32AlignTrailingComments: true
33AllowAllParametersOfDeclarationOnNextLine: true
34AllowShortBlocksOnASingleLine: false
35AllowShortCaseLabelsOnASingleLine: false
36AllowShortFunctionsOnASingleLine: All
37AllowShortIfStatementsOnASingleLine: true
38AllowShortLoopsOnASingleLine: true
39AlwaysBreakAfterDefinitionReturnType: None
40AlwaysBreakAfterReturnType: None
41AlwaysBreakBeforeMultilineStrings: true
42AlwaysBreakTemplateDeclarations: false
43BinPackArguments: false
44BinPackParameters: false
45BraceWrapping:
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
57BreakBeforeBinaryOperators: None
58BreakBeforeBraces: Custom
59BreakBeforeTernaryOperators: true
60BreakConstructorInitializersBeforeComma: true
61BreakAfterJavaFieldAnnotations: false
62BreakStringLiterals: true
63ColumnLimit:     100
64CommentPragmas:  '^ IWYU pragma:'
65ConstructorInitializerAllOnOneLineOrOnePerLine: true
66ConstructorInitializerIndentWidth: 8
67ContinuationIndentWidth: 8
68Cpp11BracedListStyle: true
69DerivePointerAlignment: false
70DisableFormat:   false
71ExperimentalAutoDetectBinPacking: false
72ForEachMacros:   [ foreach, Q_FOREACH, BOOST_FOREACH ]
73IncludeCategories:
74  - Regex:           '^<.*\.h>'
75    Priority:        1
76  - Regex:           '^<.*'
77    Priority:        2
78  - Regex:           '.*'
79    Priority:        3
80IncludeIsMainRegex: '([-_](test|unittest))?$'
81IndentCaseLabels: true
82IndentWidth:     4
83IndentWrappedFunctionNames: false
84JavaScriptQuotes: Leave
85JavaScriptWrapImports: true
86KeepEmptyLinesAtTheStartOfBlocks: false
87MaxEmptyLinesToKeep: 1
88NamespaceIndentation: None
89ObjCBlockIndentWidth: 2
90ObjCSpaceAfterProperty: false
91ObjCSpaceBeforeProtocolList: false
92PenaltyBreakBeforeFirstCallParameter: 1
93PenaltyBreakComment: 300
94PenaltyBreakFirstLessLess: 120
95PenaltyBreakString: 1000
96PenaltyExcessCharacter: 1000000
97PenaltyReturnTypeOnItsOwnLine: 200
98PointerAlignment: Left
99ReflowComments:  true
100SortIncludes:    true
101SpaceAfterCStyleCast: false
102SpaceAfterTemplateKeyword: true
103SpaceBeforeAssignmentOperators: true
104SpaceBeforeParens: ControlStatements
105SpaceInEmptyParentheses: false
106SpacesBeforeTrailingComments: 2
107SpacesInAngles:  false
108SpacesInContainerLiterals: true
109SpacesInCStyleCastParentheses: false
110SpacesInParentheses: false
111SpacesInSquareBrackets: false
112Standard:        Auto
113TabWidth:        4
114UseTab:          Never
115---
116Language:        ObjC
117AccessModifierOffset: -4
118AlignAfterOpenBracket: Align
119AlignConsecutiveAssignments: false
120AlignConsecutiveDeclarations: false
121AlignEscapedNewlinesLeft: true
122AlignOperands:   true
123AlignTrailingComments: true
124AllowAllParametersOfDeclarationOnNextLine: true
125AllowShortBlocksOnASingleLine: false
126AllowShortCaseLabelsOnASingleLine: false
127AllowShortFunctionsOnASingleLine: All
128AllowShortIfStatementsOnASingleLine: true
129AllowShortLoopsOnASingleLine: true
130AlwaysBreakAfterDefinitionReturnType: None
131AlwaysBreakAfterReturnType: None
132AlwaysBreakBeforeMultilineStrings: true
133AlwaysBreakTemplateDeclarations: false
134BinPackArguments: false
135BinPackParameters: false
136BraceWrapping:
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
148BreakBeforeBinaryOperators: None
149BreakBeforeBraces: Custom
150BreakBeforeTernaryOperators: true
151BreakConstructorInitializersBeforeComma: true
152BreakAfterJavaFieldAnnotations: false
153BreakStringLiterals: true
154ColumnLimit:     100
155CommentPragmas:  '^ IWYU pragma:'
156ConstructorInitializerAllOnOneLineOrOnePerLine: true
157ConstructorInitializerIndentWidth: 8
158ContinuationIndentWidth: 8
159Cpp11BracedListStyle: true
160DerivePointerAlignment: false
161DisableFormat:   false
162ExperimentalAutoDetectBinPacking: false
163ForEachMacros:   [ foreach, Q_FOREACH, BOOST_FOREACH ]
164IncludeCategories:
165  - Regex:           '^<.*\.h>'
166    Priority:        1
167  - Regex:           '^<.*'
168    Priority:        2
169  - Regex:           '.*'
170    Priority:        3
171IncludeIsMainRegex: '([-_](test|unittest))?$'
172IndentCaseLabels: true
173IndentWidth:     4
174IndentWrappedFunctionNames: false
175JavaScriptQuotes: Leave
176JavaScriptWrapImports: true
177KeepEmptyLinesAtTheStartOfBlocks: false
178MaxEmptyLinesToKeep: 1
179NamespaceIndentation: None
180ObjCBlockIndentWidth: 2
181ObjCSpaceAfterProperty: false
182ObjCSpaceBeforeProtocolList: false
183PenaltyBreakBeforeFirstCallParameter: 1
184PenaltyBreakComment: 300
185PenaltyBreakFirstLessLess: 120
186PenaltyBreakString: 1000
187PenaltyExcessCharacter: 1000000
188PenaltyReturnTypeOnItsOwnLine: 200
189PointerAlignment: Left
190ReflowComments:  true
191SortIncludes:    true
192SpaceAfterCStyleCast: false
193SpaceAfterTemplateKeyword: true
194SpaceBeforeAssignmentOperators: true
195SpaceBeforeParens: ControlStatements
196SpaceInEmptyParentheses: false
197SpacesBeforeTrailingComments: 2
198SpacesInAngles:  false
199SpacesInContainerLiterals: true
200SpacesInCStyleCastParentheses: false
201SpacesInParentheses: false
202SpacesInSquareBrackets: false
203Standard:        Auto
204TabWidth:        4
205UseTab:          Never
206...
207
208