1 # This format definition attempts to be as close to the style of existing
2 # HelenOS code as possible. However, there are several significant issues:
4 # "AlignEscapedNewlines: DontAlign" currently hangs
5 # the formatter on some files.
7 # The formatter currently isn't able to align macro definitions,
8 # and removes existing alignment in files.
9 # (There is a patch for this, but it hasn't been integrated yet.)
11 # SpacesBeforeTrailingComments don't apply to C-style comments.
13 # enum definition is always crammed into a single line if it fits,
14 # and there is no option to put members on separate lines.
19 # Provisions are made to reformat the entire source tree via 'make format',
20 # but due to the above, this shouldn't be done except to evaluate the
21 # impact. Reformatting a single source file can be done using
23 # clang-format -i source/file.c
28 AccessModifierOffset: 0
29 AlignAfterOpenBracket: DontAlign
30 AlignConsecutiveAssignments: false
31 AlignConsecutiveDeclarations: false
32 AlignEscapedNewlines: Left
34 AlignTrailingComments: true
35 AllowAllParametersOfDeclarationOnNextLine: true
36 AllowShortBlocksOnASingleLine: false
37 AllowShortCaseLabelsOnASingleLine: false
38 AllowShortFunctionsOnASingleLine: None
39 AllowShortIfStatementsOnASingleLine: false
40 AllowShortLoopsOnASingleLine: false
41 AlwaysBreakAfterDefinitionReturnType: None
42 AlwaysBreakAfterReturnType: None
43 AlwaysBreakBeforeMultilineStrings: false
44 AlwaysBreakTemplateDeclarations: true
45 BinPackArguments: true
46 BinPackParameters: true
49 AfterControlStatement: false
53 AfterObjCDeclaration: false
59 SplitEmptyFunction: true
60 SplitEmptyRecord: true
61 SplitEmptyNamespace: true
62 BreakBeforeBinaryOperators: NonAssignment
63 BreakBeforeBraces: Custom
64 BreakBeforeInheritanceComma: true
65 BreakBeforeTernaryOperators: true
66 BreakConstructorInitializers: BeforeColon
67 BreakStringLiterals: true
69 CompactNamespaces: false
70 ConstructorInitializerAllOnOneLineOrOnePerLine: false
71 ConstructorInitializerIndentWidth: 4
72 ContinuationIndentWidth: 4
73 Cpp11BracedListStyle: true
74 DerivePointerAlignment: false
75 FixNamespaceComments: true
87 IncludeIsMainRegex: '(-test)?$'
88 IndentCaseLabels: false
90 IndentWrappedFunctionNames: false
91 KeepEmptyLinesAtTheStartOfBlocks: true
94 MaxEmptyLinesToKeep: 1
95 NamespaceIndentation: None
96 PenaltyBreakAssignment: 2
97 PenaltyBreakBeforeFirstCallParameter: 19
98 PenaltyBreakComment: 300
99 PenaltyBreakFirstLessLess: 120
100 PenaltyBreakString: 1000
101 PenaltyExcessCharacter: 1000000
102 PenaltyReturnTypeOnItsOwnLine: 60
103 PointerAlignment: Right
106 SortUsingDeclarations: true
107 SpaceAfterCStyleCast: true
108 SpaceAfterTemplateKeyword: false
109 SpaceBeforeAssignmentOperators: true
110 SpaceBeforeParens: ControlStatements
111 SpaceInEmptyParentheses: false
112 SpacesBeforeTrailingComments: 2
113 SpacesInAngles: false
114 SpacesInContainerLiterals: false
115 SpacesInCStyleCastParentheses: false
116 SpacesInParentheses: false
117 SpacesInSquareBrackets: false
120 UseTab: ForIndentation