Skip to content

Commit ca197de

Browse files
add clang-format
1 parent ac59306 commit ca197de

File tree

3 files changed

+243
-129
lines changed

3 files changed

+243
-129
lines changed

Diff for: .clang-format

+106
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
---
2+
Language: Cpp
3+
AlignAfterOpenBracket: BlockIndent
4+
AlignConsecutiveMacros: false
5+
AlignConsecutiveAssignments: false
6+
AlignConsecutiveDeclarations: false
7+
AlignEscapedNewlines: DontAlign
8+
AlignOperands: true
9+
AlignTrailingComments: false
10+
AllowAllArgumentsOnNextLine: true
11+
AllowAllParametersOfDeclarationOnNextLine: true
12+
AllowShortBlocksOnASingleLine: Empty
13+
AllowShortCaseLabelsOnASingleLine: false
14+
AllowShortFunctionsOnASingleLine: Empty
15+
AllowShortIfStatementsOnASingleLine: Never
16+
AllowShortLoopsOnASingleLine: false
17+
AlwaysBreakAfterReturnType: None
18+
AlwaysBreakBeforeMultilineStrings: false
19+
BinPackArguments: false
20+
BinPackParameters: false
21+
BraceWrapping:
22+
AfterCaseLabel: false
23+
AfterClass: false
24+
AfterControlStatement: false
25+
AfterEnum: false
26+
AfterFunction: false
27+
AfterNamespace: false
28+
AfterObjCDeclaration: false
29+
AfterStruct: false
30+
AfterUnion: false
31+
AfterExternBlock: false
32+
BeforeCatch: false
33+
BeforeElse: false
34+
IndentBraces: false
35+
SplitEmptyFunction: false
36+
SplitEmptyRecord: false
37+
SplitEmptyNamespace: false
38+
BreakBeforeBinaryOperators: All
39+
BreakBeforeBraces: Attach
40+
BreakBeforeTernaryOperators: true
41+
BreakStringLiterals: true
42+
ColumnLimit: 75
43+
CommentPragmas: '^ IWYU pragma:'
44+
ContinuationIndentWidth: 4
45+
Cpp11BracedListStyle: true
46+
DeriveLineEnding: false
47+
DerivePointerAlignment: false
48+
DisableFormat: false
49+
ExperimentalAutoDetectBinPacking: false
50+
ForEachMacros:
51+
- foreach
52+
- Q_FOREACH
53+
- BOOST_FOREACH
54+
IncludeBlocks: Regroup
55+
IncludeCategories:
56+
- Regex: '<glad/glad.h>'
57+
Priority: 0
58+
SortPriority: 0
59+
- Regex: '.*'
60+
Priority: 1
61+
SortPriority: 0
62+
IncludeIsMainRegex: '(Test)?$'
63+
IncludeIsMainSourceRegex: ''
64+
IndentCaseLabels: true
65+
IndentGotoLabels: true
66+
IndentPPDirectives: None
67+
IndentWidth: 4
68+
IndentWrappedFunctionNames: false
69+
KeepEmptyLinesAtTheStartOfBlocks: true
70+
MacroBlockBegin: ''
71+
MacroBlockEnd: ''
72+
MaxEmptyLinesToKeep: 1
73+
PenaltyBreakAssignment: 100
74+
PenaltyBreakBeforeFirstCallParameter: 19
75+
PenaltyBreakComment: 300
76+
PenaltyBreakFirstLessLess: 120
77+
PenaltyBreakString: 1000
78+
PenaltyExcessCharacter: 1000000
79+
PenaltyReturnTypeOnItsOwnLine: 1000000
80+
PointerAlignment: Left
81+
ReflowComments: true
82+
SortIncludes: true
83+
SpaceAfterCStyleCast: false
84+
SpaceAfterLogicalNot: false
85+
SpaceBeforeAssignmentOperators: true
86+
SpaceBeforeCpp11BracedList: false
87+
SpaceBeforeParens: ControlStatements
88+
SpaceInEmptyBlock: false
89+
SpaceInEmptyParentheses: false
90+
SpacesBeforeTrailingComments: 2
91+
SpacesInAngles: false
92+
SpacesInConditionalStatement: false
93+
SpacesInContainerLiterals: false
94+
SpacesInCStyleCastParentheses: false
95+
SpacesInParentheses: false
96+
SpacesInSquareBrackets: false
97+
SpaceBeforeSquareBrackets: false
98+
Standard: Latest
99+
StatementMacros:
100+
- Q_UNUSED
101+
- QT_REQUIRE_VERSION
102+
TabWidth: 4
103+
UseCRLF: false
104+
UseTab: Never
105+
...
106+

Diff for: clang_format.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
clang-format -style=file -i `find src -name "*.c"`
3+
clang-format -style=file -i `find src -name "*.h"`

0 commit comments

Comments
 (0)