xref: /aosp_15_r20/external/gsc-utils/.clang-format (revision 4f2df630800bdcf1d4f0decf95d8a1cb87344f5f)
1# SPDX-License-Identifier: GPL-2.0
2#
3# clang-format configuration file. Intended for clang-format >= 9.
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# Note: imported from Kernel .clang-format, uncommented options that
12# require clang-format-4.0 or clang-format-5.0, and removed
13# kernel-specific macros.
14---
15AccessModifierOffset: -4
16AlignAfterOpenBracket: Align
17AlignConsecutiveAssignments: false
18AlignConsecutiveDeclarations: false
19AlignConsecutiveMacros: true
20AlignEscapedNewlines: Left
21AlignOperands: true
22AlignTrailingComments: false
23AllowAllParametersOfDeclarationOnNextLine: false
24AllowShortBlocksOnASingleLine: false
25AllowShortCaseLabelsOnASingleLine: false
26AllowShortFunctionsOnASingleLine: None
27AllowShortIfStatementsOnASingleLine: false
28AllowShortLoopsOnASingleLine: false
29AlwaysBreakAfterDefinitionReturnType: None
30AlwaysBreakAfterReturnType: None
31AlwaysBreakBeforeMultilineStrings: false
32AlwaysBreakTemplateDeclarations: false
33BinPackArguments: true
34BinPackParameters: true
35BraceWrapping:
36  AfterClass: false
37  AfterControlStatement: false
38  AfterEnum: false
39  AfterFunction: true
40  AfterNamespace: true
41  AfterObjCDeclaration: false
42  AfterStruct: false
43  AfterUnion: false
44  AfterExternBlock: false
45  BeforeCatch: false
46  BeforeElse: false
47  IndentBraces: false
48  SplitEmptyFunction: true
49  SplitEmptyRecord: true
50  SplitEmptyNamespace: true
51BreakBeforeBinaryOperators: None
52BreakBeforeBraces: Custom
53BreakBeforeInheritanceComma: false
54BreakBeforeTernaryOperators: false
55BreakConstructorInitializersBeforeComma: false
56BreakConstructorInitializers: BeforeComma
57BreakAfterJavaFieldAnnotations: false
58BreakStringLiterals: false
59ColumnLimit: 80
60CommentPragmas: '^ IWYU pragma:'
61CompactNamespaces: false
62ConstructorInitializerAllOnOneLineOrOnePerLine: false
63ConstructorInitializerIndentWidth: 8
64ContinuationIndentWidth: 8
65Cpp11BracedListStyle: false
66DerivePointerAlignment: false
67DisableFormat: false
68ExperimentalAutoDetectBinPacking: false
69FixNamespaceComments: false
70IncludeBlocks: Preserve
71IncludeCategories:
72  - Regex: '.*'
73    Priority: 1
74IncludeIsMainRegex: '(Test)?$'
75IndentCaseLabels: false
76IndentPPDirectives: None
77IndentWidth: 8
78IndentWrappedFunctionNames: false
79JavaScriptQuotes: Leave
80JavaScriptWrapImports: true
81KeepEmptyLinesAtTheStartOfBlocks: false
82MacroBlockBegin: ''
83MacroBlockEnd: ''
84MaxEmptyLinesToKeep: 1
85NamespaceIndentation: Inner
86ObjCBinPackProtocolList: Auto
87ObjCBlockIndentWidth: 8
88ObjCSpaceAfterProperty: true
89ObjCSpaceBeforeProtocolList: true
90
91# Taken from git's rules
92PenaltyBreakAssignment: 10
93PenaltyBreakBeforeFirstCallParameter: 30
94PenaltyBreakComment: 10
95PenaltyBreakFirstLessLess: 0
96PenaltyBreakString: 10
97PenaltyExcessCharacter: 100
98PenaltyReturnTypeOnItsOwnLine: 120
99
100PointerAlignment: Right
101ReflowComments: true
102SortIncludes: false
103SortUsingDeclarations: false
104SpaceAfterCStyleCast: false
105SpaceAfterTemplateKeyword: true
106SpaceBeforeAssignmentOperators: true
107SpaceBeforeCtorInitializerColon: true
108SpaceBeforeInheritanceColon: true
109SpaceBeforeParens: ControlStatements
110SpaceBeforeRangeBasedForLoopColon: true
111SpaceInEmptyParentheses: false
112SpacesBeforeTrailingComments: 1
113SpacesInAngles: false
114SpacesInContainerLiterals: false
115SpacesInCStyleCastParentheses: false
116SpacesInParentheses: false
117SpacesInSquareBrackets: false
118Standard: Cpp03
119TabWidth: 8
120UseTab: Always
121