Skip to content

Commit 752061d

Browse files
committed
add clang-format
1 parent d6070b2 commit 752061d

2 files changed

Lines changed: 96 additions & 0 deletions

File tree

.clang-format

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

check-format

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
find ./gc ./libaesnd ./libdb ./libdi ./libiso9660 ./libogc ./libtinysmb ./libwiikeyboard -name *.[h,c] -exec clang-format-18 -style=file -i {} \;

0 commit comments

Comments
 (0)