Skip to content
This repository was archived by the owner on Apr 24, 2022. It is now read-only.

Commit 7399c90

Browse files
committedJan 5, 2018
Add clang-format config
1 parent e21cdec commit 7399c90

File tree

1 file changed

+94
-0
lines changed

1 file changed

+94
-0
lines changed
 

‎.clang-format

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
---
2+
Language: Cpp
3+
# BasedOnStyle: Chromium
4+
AccessModifierOffset: -4
5+
AlignAfterOpenBracket: DontAlign
6+
AlignConsecutiveAssignments: false
7+
AlignConsecutiveDeclarations: false
8+
AlignEscapedNewlinesLeft: true
9+
AlignOperands: true
10+
AlignTrailingComments: true
11+
AllowAllParametersOfDeclarationOnNextLine: false
12+
AllowShortBlocksOnASingleLine: false
13+
AllowShortCaseLabelsOnASingleLine: false
14+
AllowShortFunctionsOnASingleLine: Inline
15+
AllowShortIfStatementsOnASingleLine: false
16+
AllowShortLoopsOnASingleLine: false
17+
AlwaysBreakAfterReturnType: None
18+
AlwaysBreakBeforeMultilineStrings: true
19+
AlwaysBreakTemplateDeclarations: true
20+
BinPackArguments: true
21+
BinPackParameters: true
22+
BreakBeforeBinaryOperators: None
23+
BreakBeforeBraces: Custom
24+
BraceWrapping:
25+
AfterClass: true
26+
AfterControlStatement: true
27+
AfterEnum: true
28+
AfterFunction: true
29+
AfterNamespace: true
30+
AfterObjCDeclaration: true
31+
AfterStruct: true
32+
AfterUnion: true
33+
BeforeCatch: true
34+
BeforeElse: true
35+
IndentBraces: false
36+
SplitEmptyFunction: false
37+
BreakBeforeTernaryOperators: false
38+
BreakConstructorInitializers: BeforeColon
39+
ColumnLimit: 100
40+
CommentPragmas: '^ IWYU pragma:'
41+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
42+
ConstructorInitializerIndentWidth: 2
43+
ContinuationIndentWidth: 4
44+
Cpp11BracedListStyle: true
45+
DerivePointerAlignment: false
46+
DisableFormat: false
47+
ExperimentalAutoDetectBinPacking: false
48+
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
49+
IncludeCategories:
50+
- Regex: '^".*'
51+
Priority: 1
52+
- Regex: '^<boost.*'
53+
Priority: 98
54+
- Regex: '^<.*\.h>'
55+
Priority: 2
56+
- Regex: '^<.*'
57+
Priority: 99
58+
- Regex: '.*'
59+
Priority: 4
60+
IndentCaseLabels: false
61+
IndentWidth: 4
62+
IndentWrappedFunctionNames: false
63+
KeepEmptyLinesAtTheStartOfBlocks: false
64+
MacroBlockBegin: ''
65+
MacroBlockEnd: ''
66+
MaxEmptyLinesToKeep: 2
67+
NamespaceIndentation: None
68+
ObjCBlockIndentWidth: 2
69+
ObjCSpaceAfterProperty: false
70+
ObjCSpaceBeforeProtocolList: false
71+
PenaltyBreakAssignment: 1
72+
PenaltyBreakBeforeFirstCallParameter: 1
73+
PenaltyBreakComment: 50
74+
PenaltyBreakFirstLessLess: 120
75+
PenaltyBreakString: 1000
76+
PenaltyExcessCharacter: 1000000
77+
PenaltyReturnTypeOnItsOwnLine: 200
78+
PointerAlignment: Left
79+
ReflowComments: true
80+
SortIncludes: true
81+
SpaceAfterCStyleCast: false
82+
SpaceBeforeAssignmentOperators: true
83+
SpaceBeforeParens: ControlStatements
84+
SpaceInEmptyParentheses: false
85+
SpacesBeforeTrailingComments: 2
86+
SpacesInAngles: false
87+
SpacesInContainerLiterals: true
88+
SpacesInCStyleCastParentheses: false
89+
SpacesInParentheses: false
90+
SpacesInSquareBrackets: false
91+
Standard: Auto
92+
TabWidth: 4
93+
UseTab: Never
94+
...

1 commit comments

Comments
 (1)

EoD commented on Jan 5, 2018

@EoD
Contributor

@chfast While I love the idea of finally having a clang-format config, wouldn't it be better to let it base on some of the major formats (google? chromium?) and only specify the stuff which is deviating?
Otherwise the code might be super custom and new developers are having a hard time to use this special "theme"?

This repository has been archived.