Skip to content

Commit 17641e5

Browse files
Maurizio Ingrassiapaceholder
authored andcommitted
Add clang-format config similar to QtCreator (paceholder#146)
1 parent b4f51e1 commit 17641e5

File tree

1 file changed

+102
-0
lines changed

1 file changed

+102
-0
lines changed

.clang-format

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
Language: Cpp
3+
AccessModifierOffset: -4
4+
AlignAfterOpenBracket: Align
5+
AlignConsecutiveAssignments: false
6+
AlignConsecutiveDeclarations: false
7+
AlignEscapedNewlines: DontAlign
8+
AlignOperands: true
9+
AlignTrailingComments: true
10+
AllowAllParametersOfDeclarationOnNextLine: true
11+
AllowShortBlocksOnASingleLine: false
12+
AllowShortCaseLabelsOnASingleLine: false
13+
AllowShortFunctionsOnASingleLine: Inline
14+
AllowShortIfStatementsOnASingleLine: false
15+
AllowShortLoopsOnASingleLine: false
16+
AlwaysBreakAfterReturnType: None
17+
AlwaysBreakBeforeMultilineStrings: false
18+
AlwaysBreakTemplateDeclarations: true
19+
BinPackArguments: false
20+
BinPackParameters: false
21+
BraceWrapping:
22+
AfterClass: true
23+
AfterControlStatement: false
24+
AfterEnum: false
25+
AfterFunction: true
26+
AfterNamespace: false
27+
AfterObjCDeclaration: false
28+
AfterStruct: true
29+
AfterUnion: false
30+
BeforeCatch: false
31+
BeforeElse: false
32+
IndentBraces: false
33+
SplitEmptyFunction: false
34+
SplitEmptyRecord: false
35+
SplitEmptyNamespace: false
36+
BreakBeforeBinaryOperators: All
37+
BreakBeforeBraces: Custom
38+
BreakBeforeInheritanceComma: false
39+
BreakBeforeTernaryOperators: true
40+
BreakConstructorInitializersBeforeComma: false
41+
BreakConstructorInitializers: BeforeComma
42+
BreakAfterJavaFieldAnnotations: false
43+
BreakStringLiterals: true
44+
ColumnLimit: 100
45+
CommentPragmas: '^ IWYU pragma:'
46+
CompactNamespaces: false
47+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
48+
ConstructorInitializerIndentWidth: 4
49+
ContinuationIndentWidth: 4
50+
Cpp11BracedListStyle: true
51+
DerivePointerAlignment: false
52+
DisableFormat: false
53+
ExperimentalAutoDetectBinPacking: false
54+
FixNamespaceComments: true
55+
ForEachMacros:
56+
- forever # avoids { wrapped to next line
57+
- foreach
58+
- Q_FOREACH
59+
- BOOST_FOREACH
60+
IncludeCategories:
61+
- Regex: '^<Q.*'
62+
Priority: 200
63+
IncludeIsMainRegex: '(Test)?$'
64+
IndentCaseLabels: false
65+
IndentWidth: 4
66+
IndentWrappedFunctionNames: false
67+
JavaScriptQuotes: Leave
68+
JavaScriptWrapImports: true
69+
KeepEmptyLinesAtTheStartOfBlocks: false
70+
# Do not add QT_BEGIN_NAMESPACE/QT_END_NAMESPACE as this will indent lines in between.
71+
MacroBlockBegin: ""
72+
MacroBlockEnd: ""
73+
MaxEmptyLinesToKeep: 1
74+
NamespaceIndentation: None
75+
ObjCBlockIndentWidth: 4
76+
ObjCSpaceAfterProperty: false
77+
ObjCSpaceBeforeProtocolList: true
78+
PenaltyBreakAssignment: 150
79+
PenaltyBreakBeforeFirstCallParameter: 300
80+
PenaltyBreakComment: 500
81+
PenaltyBreakFirstLessLess: 400
82+
PenaltyBreakString: 600
83+
PenaltyExcessCharacter: 50
84+
PenaltyReturnTypeOnItsOwnLine: 300
85+
PointerAlignment: Right
86+
ReflowComments: false
87+
SortIncludes: true
88+
SortUsingDeclarations: true
89+
SpaceAfterCStyleCast: true
90+
SpaceAfterTemplateKeyword: false
91+
SpaceBeforeAssignmentOperators: true
92+
SpaceBeforeParens: ControlStatements
93+
SpaceInEmptyParentheses: false
94+
SpacesBeforeTrailingComments: 1
95+
SpacesInAngles: false
96+
SpacesInContainerLiterals: false
97+
SpacesInCStyleCastParentheses: false
98+
SpacesInParentheses: false
99+
SpacesInSquareBrackets: false
100+
Standard: Cpp11
101+
TabWidth: 4
102+
UseTab: Never

0 commit comments

Comments
 (0)