blob: 39f540349fd3f339f0f10a36e085ca0de7080a31 [file] [log] [blame]
Jack Rosenthal90e3d712019-11-08 14:42:31 -07001# 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
19AlignEscapedNewlines: Left
20AlignOperands: true
21AlignTrailingComments: false
22AllowAllParametersOfDeclarationOnNextLine: false
23AllowShortBlocksOnASingleLine: false
24AllowShortCaseLabelsOnASingleLine: false
25AllowShortFunctionsOnASingleLine: None
Raul E Rangel88dd3f72018-04-03 14:55:57 -060026AllowShortIfStatementsOnASingleLine: false
Jack Rosenthal90e3d712019-11-08 14:42:31 -070027AllowShortLoopsOnASingleLine: false
28AlwaysBreakAfterDefinitionReturnType: None
29AlwaysBreakAfterReturnType: None
30AlwaysBreakBeforeMultilineStrings: false
31AlwaysBreakTemplateDeclarations: false
32BinPackArguments: true
33BinPackParameters: true
34BraceWrapping:
35 AfterClass: false
36 AfterControlStatement: false
37 AfterEnum: false
38 AfterFunction: true
39 AfterNamespace: true
40 AfterObjCDeclaration: false
41 AfterStruct: false
42 AfterUnion: false
43 AfterExternBlock: false
44 BeforeCatch: false
45 BeforeElse: false
46 IndentBraces: false
47 SplitEmptyFunction: true
48 SplitEmptyRecord: true
49 SplitEmptyNamespace: true
50BreakBeforeBinaryOperators: None
51BreakBeforeBraces: Custom
52BreakBeforeInheritanceComma: false
53BreakBeforeTernaryOperators: false
54BreakConstructorInitializersBeforeComma: false
55BreakConstructorInitializers: BeforeComma
56BreakAfterJavaFieldAnnotations: false
57BreakStringLiterals: false
58ColumnLimit: 80
59CommentPragmas: '^ IWYU pragma:'
60CompactNamespaces: false
61ConstructorInitializerAllOnOneLineOrOnePerLine: false
62ConstructorInitializerIndentWidth: 8
63ContinuationIndentWidth: 8
64Cpp11BracedListStyle: false
65DerivePointerAlignment: false
66DisableFormat: false
67ExperimentalAutoDetectBinPacking: false
68FixNamespaceComments: false
69IncludeBlocks: Preserve
70IncludeCategories:
71 - Regex: '.*'
72 Priority: 1
73IncludeIsMainRegex: '(Test)?$'
Raul E Rangel88dd3f72018-04-03 14:55:57 -060074IndentCaseLabels: false
Jack Rosenthal90e3d712019-11-08 14:42:31 -070075IndentPPDirectives: None
76IndentWidth: 8
77IndentWrappedFunctionNames: false
78JavaScriptQuotes: Leave
79JavaScriptWrapImports: true
80KeepEmptyLinesAtTheStartOfBlocks: false
81MacroBlockBegin: ''
82MacroBlockEnd: ''
83MaxEmptyLinesToKeep: 1
84NamespaceIndentation: Inner
85ObjCBinPackProtocolList: Auto
86ObjCBlockIndentWidth: 8
87ObjCSpaceAfterProperty: true
88ObjCSpaceBeforeProtocolList: true
89
90# Taken from git's rules
91PenaltyBreakAssignment: 10
92PenaltyBreakBeforeFirstCallParameter: 30
93PenaltyBreakComment: 10
94PenaltyBreakFirstLessLess: 0
95PenaltyBreakString: 10
96PenaltyExcessCharacter: 100
97PenaltyReturnTypeOnItsOwnLine: 60
98
99PointerAlignment: Right
100ReflowComments: false
101SortIncludes: false
102SortUsingDeclarations: false
103SpaceAfterCStyleCast: false
104SpaceAfterTemplateKeyword: true
105SpaceBeforeAssignmentOperators: true
106SpaceBeforeCtorInitializerColon: true
107SpaceBeforeInheritanceColon: true
108SpaceBeforeParens: ControlStatements
109SpaceBeforeRangeBasedForLoopColon: true
110SpaceInEmptyParentheses: false
111SpacesBeforeTrailingComments: 1
112SpacesInAngles: false
113SpacesInContainerLiterals: false
114SpacesInCStyleCastParentheses: false
115SpacesInParentheses: false
116SpacesInSquareBrackets: false
117Standard: Cpp03
118TabWidth: 8
119UseTab: Always