Skip to content

Commit cdb99e1

Browse files
committed
Add a clang-format file with a style based on Google style
1 parent 43dfa9c commit cdb99e1

File tree

1 file changed

+105
-0
lines changed

1 file changed

+105
-0
lines changed

.clang-format

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

0 commit comments

Comments
 (0)