xref: /openbmc/docs/style/c/.clang-format (revision dc24b2eca42c8a340fcc001f882177d4c2abb289)
1d1d05ee6SAndrew Jeffery# SPDX-License-Identifier: GPL-2.0
2d1d05ee6SAndrew Jeffery#
3d1d05ee6SAndrew Jeffery# Originally from Linux v5.6
4d1d05ee6SAndrew Jeffery---
5d1d05ee6SAndrew JefferyAccessModifierOffset: -4
6d1d05ee6SAndrew JefferyAlignAfterOpenBracket: Align
7d1d05ee6SAndrew JefferyAlignConsecutiveMacros: true
8d1d05ee6SAndrew JefferyAlignConsecutiveAssignments: false
9d1d05ee6SAndrew JefferyAlignConsecutiveDeclarations: false
10d1d05ee6SAndrew Jeffery#AlignEscapedNewlines: Left # Unknown to clang-format-4.0
11d1d05ee6SAndrew JefferyAlignOperands:  Align
12d1d05ee6SAndrew JefferyAlignTrailingComments:
13d1d05ee6SAndrew Jeffery  Kind: Always
14d1d05ee6SAndrew Jeffery  OverEmptyLines: 1
15d1d05ee6SAndrew JefferyAllowAllParametersOfDeclarationOnNextLine: false
16d1d05ee6SAndrew JefferyAllowShortBlocksOnASingleLine: false
17d1d05ee6SAndrew JefferyAllowShortCaseLabelsOnASingleLine: false
18d1d05ee6SAndrew JefferyAllowShortFunctionsOnASingleLine: None
19d1d05ee6SAndrew JefferyAllowShortIfStatementsOnASingleLine: false
20d1d05ee6SAndrew JefferyAllowShortLoopsOnASingleLine: false
21d1d05ee6SAndrew JefferyAlwaysBreakAfterDefinitionReturnType: None
22d1d05ee6SAndrew JefferyAlwaysBreakAfterReturnType: None
23d1d05ee6SAndrew JefferyAlwaysBreakBeforeMultilineStrings: false
24d1d05ee6SAndrew JefferyAlwaysBreakTemplateDeclarations: false
25d1d05ee6SAndrew JefferyBinPackArguments: true
26d1d05ee6SAndrew JefferyBinPackParameters: true
27d1d05ee6SAndrew JefferyBraceWrapping:
28d1d05ee6SAndrew Jeffery  AfterClass: false
29d1d05ee6SAndrew Jeffery  AfterControlStatement: false
30d1d05ee6SAndrew Jeffery  AfterEnum: false
31d1d05ee6SAndrew Jeffery  AfterFunction: true
32d1d05ee6SAndrew Jeffery  AfterNamespace: true
33d1d05ee6SAndrew Jeffery  AfterObjCDeclaration: false
34d1d05ee6SAndrew Jeffery  AfterStruct: false
35d1d05ee6SAndrew Jeffery  AfterUnion: false
36d1d05ee6SAndrew Jeffery  #AfterExternBlock: false # Unknown to clang-format-5.0
37d1d05ee6SAndrew Jeffery  BeforeCatch: false
38d1d05ee6SAndrew Jeffery  BeforeElse: false
39d1d05ee6SAndrew Jeffery  IndentBraces: false
40d1d05ee6SAndrew Jeffery  #SplitEmptyFunction: true # Unknown to clang-format-4.0
41d1d05ee6SAndrew Jeffery  #SplitEmptyRecord: true # Unknown to clang-format-4.0
42d1d05ee6SAndrew Jeffery  #SplitEmptyNamespace: true # Unknown to clang-format-4.0
43d1d05ee6SAndrew JefferyBreakAfterAttributes: Never
44d1d05ee6SAndrew JefferyBreakBeforeBinaryOperators: None
45d1d05ee6SAndrew JefferyBreakBeforeBraces: Custom
46d1d05ee6SAndrew Jeffery#BreakBeforeInheritanceComma: false # Unknown to clang-format-4.0
47d1d05ee6SAndrew JefferyBreakBeforeTernaryOperators: false
48d1d05ee6SAndrew JefferyBreakConstructorInitializersBeforeComma: false
49d1d05ee6SAndrew Jeffery#BreakConstructorInitializers: BeforeComma # Unknown to clang-format-4.0
50d1d05ee6SAndrew JefferyBreakAfterJavaFieldAnnotations: false
51d1d05ee6SAndrew JefferyBreakStringLiterals: false
52d1d05ee6SAndrew JefferyColumnLimit: 80
53d1d05ee6SAndrew JefferyCommentPragmas: '^ IWYU pragma:'
54d1d05ee6SAndrew Jeffery#CompactNamespaces: false # Unknown to clang-format-4.0
55d1d05ee6SAndrew JefferyConstructorInitializerAllOnOneLineOrOnePerLine: false
56d1d05ee6SAndrew JefferyConstructorInitializerIndentWidth: 8
57d1d05ee6SAndrew JefferyContinuationIndentWidth: 8
58d1d05ee6SAndrew JefferyCpp11BracedListStyle: false
59d1d05ee6SAndrew JefferyDeriveLineEnding: false
60d1d05ee6SAndrew JefferyDerivePointerAlignment: false
61d1d05ee6SAndrew JefferyDisableFormat: false
62d1d05ee6SAndrew JefferyExperimentalAutoDetectBinPacking: false
63d1d05ee6SAndrew Jeffery#FixNamespaceComments: false # Unknown to clang-format-4.0
64d1d05ee6SAndrew Jeffery#IncludeBlocks: Preserve # Unknown to clang-format-5.0
65d1d05ee6SAndrew JefferyIncludeCategories:
66d1d05ee6SAndrew Jeffery  - Regex: '.*'
67d1d05ee6SAndrew Jeffery    Priority: 1
68d1d05ee6SAndrew JefferyIncludeIsMainRegex: '(Test)?$'
69d1d05ee6SAndrew JefferyIndentCaseLabels: false
70*dc24b2ecSPatrick WilliamsIndentExternBlock: NoIndent
71d1d05ee6SAndrew Jeffery#IndentPPDirectives: None # Unknown to clang-format-5.0
72d1d05ee6SAndrew JefferyIndentWidth: 8
73d1d05ee6SAndrew JefferyIndentWrappedFunctionNames: false
74d1d05ee6SAndrew JefferyInsertNewlineAtEOF: true
75d1d05ee6SAndrew JefferyJavaScriptQuotes: Leave
76d1d05ee6SAndrew JefferyJavaScriptWrapImports: true
77d1d05ee6SAndrew JefferyKeepEmptyLinesAtTheStartOfBlocks: false
78d1d05ee6SAndrew JefferyLineEnding: LF
79d1d05ee6SAndrew JefferyMacroBlockBegin: ''
80d1d05ee6SAndrew JefferyMacroBlockEnd: ''
81d1d05ee6SAndrew JefferyMaxEmptyLinesToKeep: 1
82d1d05ee6SAndrew JefferyNamespaceIndentation: Inner
83d1d05ee6SAndrew Jeffery#ObjCBinPackProtocolList: Auto # Unknown to clang-format-5.0
84d1d05ee6SAndrew JefferyObjCBlockIndentWidth: 8
85d1d05ee6SAndrew JefferyObjCSpaceAfterProperty: true
86d1d05ee6SAndrew JefferyObjCSpaceBeforeProtocolList: true
87d1d05ee6SAndrew Jeffery
88d1d05ee6SAndrew Jeffery# Taken from git's rules
89d1d05ee6SAndrew JefferyPenaltyBreakAssignment: 10
90d1d05ee6SAndrew JefferyPenaltyBreakBeforeFirstCallParameter: 30
91d1d05ee6SAndrew JefferyPenaltyBreakComment: 10
92d1d05ee6SAndrew JefferyPenaltyBreakFirstLessLess: 0
93d1d05ee6SAndrew JefferyPenaltyBreakString: 10
94d1d05ee6SAndrew JefferyPenaltyExcessCharacter: 100
95d1d05ee6SAndrew JefferyPenaltyReturnTypeOnItsOwnLine: 60
96d1d05ee6SAndrew Jeffery
97d1d05ee6SAndrew JefferyPointerAlignment: Right
98d1d05ee6SAndrew JefferyReflowComments: false
99d1d05ee6SAndrew JefferySortIncludes: false
100d1d05ee6SAndrew Jeffery#SortUsingDeclarations: false # Unknown to clang-format-4.0
101d1d05ee6SAndrew JefferySpaceAfterCStyleCast: false
102d1d05ee6SAndrew JefferySpaceAfterTemplateKeyword: true
103d1d05ee6SAndrew JefferySpaceBeforeAssignmentOperators: true
104d1d05ee6SAndrew Jeffery#SpaceBeforeCtorInitializerColon: true # Unknown to clang-format-5.0
105d1d05ee6SAndrew Jeffery#SpaceBeforeInheritanceColon: true # Unknown to clang-format-5.0
106d1d05ee6SAndrew JefferySpaceBeforeParens: ControlStatements
107d1d05ee6SAndrew Jeffery#SpaceBeforeRangeBasedForLoopColon: true # Unknown to clang-format-5.0
108d1d05ee6SAndrew JefferySpaceInEmptyParentheses: false
109d1d05ee6SAndrew JefferySpacesBeforeTrailingComments: 1
110d1d05ee6SAndrew JefferySpacesInAngles: false
111d1d05ee6SAndrew JefferySpacesInContainerLiterals: false
112d1d05ee6SAndrew JefferySpacesInCStyleCastParentheses: false
113d1d05ee6SAndrew JefferySpacesInParentheses: false
114d1d05ee6SAndrew JefferySpacesInSquareBrackets: false
115d1d05ee6SAndrew JefferyStandard: Cpp03
116d1d05ee6SAndrew JefferyTabWidth: 8
117d1d05ee6SAndrew JefferyUseTab: Always
118d1d05ee6SAndrew Jeffery...
119