Skip to content

Commit fbd0021

Browse files
committed
Add Godot project .clang-format file
1 parent f836481 commit fbd0021

File tree

1 file changed

+199
-0
lines changed

1 file changed

+199
-0
lines changed

.clang-format

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
# Commented out parameters are those with the same value as base LLVM style.
2+
# We can uncomment them if we want to change their value, or enforce the
3+
# chosen value in case the base style changes (last sync: Clang 14.0).
4+
---
5+
### General config, applies to all languages ###
6+
BasedOnStyle: LLVM
7+
AccessModifierOffset: -4
8+
AlignAfterOpenBracket: DontAlign
9+
# AlignArrayOfStructures: None
10+
# AlignConsecutiveMacros: None
11+
# AlignConsecutiveAssignments: None
12+
# AlignConsecutiveBitFields: None
13+
# AlignConsecutiveDeclarations: None
14+
# AlignEscapedNewlines: Right
15+
AlignOperands: DontAlign
16+
AlignTrailingComments: false
17+
# AllowAllArgumentsOnNextLine: true
18+
AllowAllParametersOfDeclarationOnNextLine: false
19+
# AllowShortEnumsOnASingleLine: true
20+
# AllowShortBlocksOnASingleLine: Never
21+
# AllowShortCaseLabelsOnASingleLine: false
22+
# AllowShortFunctionsOnASingleLine: All
23+
# AllowShortLambdasOnASingleLine: All
24+
# AllowShortIfStatementsOnASingleLine: Never
25+
# AllowShortLoopsOnASingleLine: false
26+
# AlwaysBreakAfterDefinitionReturnType: None
27+
# AlwaysBreakAfterReturnType: None
28+
# AlwaysBreakBeforeMultilineStrings: false
29+
# AlwaysBreakTemplateDeclarations: MultiLine
30+
# AttributeMacros:
31+
# - __capability
32+
# BinPackArguments: true
33+
# BinPackParameters: true
34+
# BraceWrapping:
35+
# AfterCaseLabel: false
36+
# AfterClass: false
37+
# AfterControlStatement: Never
38+
# AfterEnum: false
39+
# AfterFunction: false
40+
# AfterNamespace: false
41+
# AfterObjCDeclaration: false
42+
# AfterStruct: false
43+
# AfterUnion: false
44+
# AfterExternBlock: false
45+
# BeforeCatch: false
46+
# BeforeElse: false
47+
# BeforeLambdaBody: false
48+
# BeforeWhile: false
49+
# IndentBraces: false
50+
# SplitEmptyFunction: true
51+
# SplitEmptyRecord: true
52+
# SplitEmptyNamespace: true
53+
# BreakBeforeBinaryOperators: None
54+
# BreakBeforeConceptDeclarations: true
55+
# BreakBeforeBraces: Attach
56+
# BreakBeforeInheritanceComma: false
57+
# BreakInheritanceList: BeforeColon
58+
# BreakBeforeTernaryOperators: true
59+
# BreakConstructorInitializersBeforeComma: false
60+
BreakConstructorInitializers: AfterColon
61+
# BreakStringLiterals: true
62+
ColumnLimit: 0
63+
# CommentPragmas: '^ IWYU pragma:'
64+
# QualifierAlignment: Leave
65+
# CompactNamespaces: false
66+
ConstructorInitializerIndentWidth: 8
67+
ContinuationIndentWidth: 8
68+
Cpp11BracedListStyle: false
69+
# DeriveLineEnding: true
70+
# DerivePointerAlignment: false
71+
# DisableFormat: false
72+
# EmptyLineAfterAccessModifier: Never
73+
# EmptyLineBeforeAccessModifier: LogicalBlock
74+
# ExperimentalAutoDetectBinPacking: false
75+
# PackConstructorInitializers: BinPack
76+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
77+
# AllowAllConstructorInitializersOnNextLine: true
78+
# FixNamespaceComments: true
79+
# ForEachMacros:
80+
# - foreach
81+
# - Q_FOREACH
82+
# - BOOST_FOREACH
83+
# IfMacros:
84+
# - KJ_IF_MAYBE
85+
# IncludeBlocks: Preserve
86+
IncludeCategories:
87+
- Regex: '".*"'
88+
Priority: 1
89+
- Regex: '^<.*\.h>'
90+
Priority: 2
91+
- Regex: '^<.*'
92+
Priority: 3
93+
# IncludeIsMainRegex: '(Test)?$'
94+
# IncludeIsMainSourceRegex: ''
95+
# IndentAccessModifiers: false
96+
IndentCaseLabels: true
97+
# IndentCaseBlocks: false
98+
# IndentGotoLabels: true
99+
# IndentPPDirectives: None
100+
# IndentExternBlock: AfterExternBlock
101+
# IndentRequires: false
102+
IndentWidth: 4
103+
# IndentWrappedFunctionNames: false
104+
# InsertTrailingCommas: None
105+
# JavaScriptQuotes: Leave
106+
# JavaScriptWrapImports: true
107+
KeepEmptyLinesAtTheStartOfBlocks: false
108+
# LambdaBodyIndentation: Signature
109+
# MacroBlockBegin: ''
110+
# MacroBlockEnd: ''
111+
# MaxEmptyLinesToKeep: 1
112+
# NamespaceIndentation: None
113+
# PenaltyBreakAssignment: 2
114+
# PenaltyBreakBeforeFirstCallParameter: 19
115+
# PenaltyBreakComment: 300
116+
# PenaltyBreakFirstLessLess: 120
117+
# PenaltyBreakOpenParenthesis: 0
118+
# PenaltyBreakString: 1000
119+
# PenaltyBreakTemplateDeclaration: 10
120+
# PenaltyExcessCharacter: 1000000
121+
# PenaltyReturnTypeOnItsOwnLine: 60
122+
# PenaltyIndentedWhitespace: 0
123+
# PointerAlignment: Right
124+
# PPIndentWidth: -1
125+
# ReferenceAlignment: Pointer
126+
# ReflowComments: true
127+
# RemoveBracesLLVM: false
128+
# SeparateDefinitionBlocks: Leave
129+
# ShortNamespaceLines: 1
130+
# SortIncludes: CaseSensitive
131+
# SortJavaStaticImport: Before
132+
# SortUsingDeclarations: true
133+
# SpaceAfterCStyleCast: false
134+
# SpaceAfterLogicalNot: false
135+
# SpaceAfterTemplateKeyword: true
136+
# SpaceBeforeAssignmentOperators: true
137+
# SpaceBeforeCaseColon: false
138+
# SpaceBeforeCpp11BracedList: false
139+
# SpaceBeforeCtorInitializerColon: true
140+
# SpaceBeforeInheritanceColon: true
141+
# SpaceBeforeParens: ControlStatements
142+
# SpaceBeforeParensOptions:
143+
# AfterControlStatements: true
144+
# AfterForeachMacros: true
145+
# AfterFunctionDefinitionName: false
146+
# AfterFunctionDeclarationName: false
147+
# AfterIfMacros: true
148+
# AfterOverloadedOperator: false
149+
# BeforeNonEmptyParentheses: false
150+
# SpaceAroundPointerQualifiers: Default
151+
# SpaceBeforeRangeBasedForLoopColon: true
152+
# SpaceInEmptyBlock: false
153+
# SpaceInEmptyParentheses: false
154+
# SpacesBeforeTrailingComments: 1
155+
# SpacesInAngles: Never
156+
# SpacesInConditionalStatement: false
157+
# SpacesInContainerLiterals: true
158+
# SpacesInCStyleCastParentheses: false
159+
## Godot TODO: We'll want to use a min of 1, but we need to see how to fix
160+
## our comment capitalization at the same time.
161+
SpacesInLineCommentPrefix:
162+
Minimum: 0
163+
Maximum: -1
164+
# SpacesInParentheses: false
165+
# SpacesInSquareBrackets: false
166+
# SpaceBeforeSquareBrackets: false
167+
# BitFieldColonSpacing: Both
168+
# StatementAttributeLikeMacros:
169+
# - Q_EMIT
170+
# StatementMacros:
171+
# - Q_UNUSED
172+
# - QT_REQUIRE_VERSION
173+
TabWidth: 4
174+
# UseCRLF: false
175+
UseTab: Always
176+
# WhitespaceSensitiveMacros:
177+
# - STRINGIZE
178+
# - PP_STRINGIZE
179+
# - BOOST_PP_STRINGIZE
180+
# - NS_SWIFT_NAME
181+
# - CF_SWIFT_NAME
182+
---
183+
### C++ specific config ###
184+
Language: Cpp
185+
Standard: c++17
186+
---
187+
### ObjC specific config ###
188+
Language: ObjC
189+
# ObjCBinPackProtocolList: Auto
190+
ObjCBlockIndentWidth: 4
191+
# ObjCBreakBeforeNestedBlockParam: true
192+
# ObjCSpaceAfterProperty: false
193+
# ObjCSpaceBeforeProtocolList: true
194+
---
195+
### Java specific config ###
196+
Language: Java
197+
# BreakAfterJavaFieldAnnotations: false
198+
JavaImportGroups: ['org.godotengine', 'android', 'androidx', 'com.android', 'com.google', 'java', 'javax']
199+
...

0 commit comments

Comments
 (0)