source: mainline/.clang-format@ d4f9a2a

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since d4f9a2a was b1efe3e, checked in by jzr <zarevucky.jiri@…>, 8 years ago

Add partial support for clang-format.

  • Property mode set to 100644
File size: 3.6 KB
Line 
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:
3#
4# "AlignEscapedNewlines: DontAlign" currently hangs
5# the formatter on some files.
6#
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.)
10#
11# SpacesBeforeTrailingComments don't apply to C-style comments.
12#
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.
15#
16# Possibly others.
17#
18#
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
22#
23# clang-format -i source/file.c
24#
25---
26Language: Cpp
27BasedOnStyle: LLVM
28AccessModifierOffset: 0
29AlignAfterOpenBracket: DontAlign
30AlignConsecutiveAssignments: false
31AlignConsecutiveDeclarations: false
32AlignEscapedNewlines: Left
33AlignOperands: false
34AlignTrailingComments: true
35AllowAllParametersOfDeclarationOnNextLine: true
36AllowShortBlocksOnASingleLine: false
37AllowShortCaseLabelsOnASingleLine: false
38AllowShortFunctionsOnASingleLine: None
39AllowShortIfStatementsOnASingleLine: false
40AllowShortLoopsOnASingleLine: false
41AlwaysBreakAfterDefinitionReturnType: None
42AlwaysBreakAfterReturnType: None
43AlwaysBreakBeforeMultilineStrings: false
44AlwaysBreakTemplateDeclarations: true
45BinPackArguments: true
46BinPackParameters: true
47BraceWrapping:
48 AfterClass: false
49 AfterControlStatement: false
50 AfterEnum: false
51 AfterFunction: true
52 AfterNamespace: false
53 AfterObjCDeclaration: false
54 AfterStruct: false
55 AfterUnion: false
56 BeforeCatch: false
57 BeforeElse: false
58 IndentBraces: false
59 SplitEmptyFunction: true
60 SplitEmptyRecord: true
61 SplitEmptyNamespace: true
62BreakBeforeBinaryOperators: NonAssignment
63BreakBeforeBraces: Custom
64BreakBeforeInheritanceComma: true
65BreakBeforeTernaryOperators: true
66BreakConstructorInitializers: BeforeColon
67BreakStringLiterals: true
68ColumnLimit: 80
69CompactNamespaces: false
70ConstructorInitializerAllOnOneLineOrOnePerLine: false
71ConstructorInitializerIndentWidth: 4
72ContinuationIndentWidth: 4
73Cpp11BracedListStyle: true
74DerivePointerAlignment: false
75FixNamespaceComments: true
76ForEachMacros:
77 - foreach
78 - Q_FOREACH
79 - BOOST_FOREACH
80IncludeCategories:
81 - Regex: '^"'
82 Priority: 3
83 - Regex: '^<'
84 Priority: 2
85 - Regex: '.*'
86 Priority: 1
87IncludeIsMainRegex: '(-test)?$'
88IndentCaseLabels: false
89IndentWidth: 8
90IndentWrappedFunctionNames: false
91KeepEmptyLinesAtTheStartOfBlocks: true
92MacroBlockBegin: ''
93MacroBlockEnd: ''
94MaxEmptyLinesToKeep: 1
95NamespaceIndentation: None
96PenaltyBreakAssignment: 2
97PenaltyBreakBeforeFirstCallParameter: 19
98PenaltyBreakComment: 300
99PenaltyBreakFirstLessLess: 120
100PenaltyBreakString: 1000
101PenaltyExcessCharacter: 1000000
102PenaltyReturnTypeOnItsOwnLine: 60
103PointerAlignment: Right
104ReflowComments: true
105SortIncludes: true
106SortUsingDeclarations: true
107SpaceAfterCStyleCast: true
108SpaceAfterTemplateKeyword: false
109SpaceBeforeAssignmentOperators: true
110SpaceBeforeParens: ControlStatements
111SpaceInEmptyParentheses: false
112SpacesBeforeTrailingComments: 2
113SpacesInAngles: false
114SpacesInContainerLiterals: false
115SpacesInCStyleCastParentheses: false
116SpacesInParentheses: false
117SpacesInSquareBrackets: false
118Standard: Cpp11
119TabWidth: 8
120UseTab: ForIndentation
121...
122
Note: See TracBrowser for help on using the repository browser.