Skip to content

Commit da9764a

Browse files
committed
Merge pull request godotengine#93313 from Repiteo/ci/clang-format
CI: Update `clang-format` pre-commit hook to latest version
2 parents 0a4aedb + e90c5a4 commit da9764a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+294
-240
lines changed

.clang-format

Lines changed: 140 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,199 +1,248 @@
11
# Commented out parameters are those with the same value as base LLVM style.
22
# 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
3+
# chosen value in case the base style changes (last sync: Clang 18.1.8).
4+
BasedOnStyle: LLVM
75
AccessModifierOffset: -4
86
AlignAfterOpenBracket: DontAlign
97
# AlignArrayOfStructures: None
10-
# AlignConsecutiveMacros: None
11-
# AlignConsecutiveAssignments: None
12-
# AlignConsecutiveBitFields: None
13-
# AlignConsecutiveDeclarations: None
8+
# AlignConsecutiveAssignments:
9+
# Enabled: false
10+
# AcrossEmptyLines: false
11+
# AcrossComments: false
12+
# AlignCompound: false
13+
# AlignFunctionPointers: false
14+
# PadOperators: true
15+
# AlignConsecutiveBitFields:
16+
# Enabled: false
17+
# AcrossEmptyLines: false
18+
# AcrossComments: false
19+
# AlignCompound: false
20+
# AlignFunctionPointers: false
21+
# PadOperators: false
22+
# AlignConsecutiveDeclarations:
23+
# Enabled: false
24+
# AcrossEmptyLines: false
25+
# AcrossComments: false
26+
# AlignCompound: false
27+
# AlignFunctionPointers: false
28+
# PadOperators: false
29+
# AlignConsecutiveMacros:
30+
# Enabled: false
31+
# AcrossEmptyLines: false
32+
# AcrossComments: false
33+
# AlignCompound: false
34+
# AlignFunctionPointers: false
35+
# PadOperators: false
36+
# AlignConsecutiveShortCaseStatements:
37+
# Enabled: false
38+
# AcrossEmptyLines: false
39+
# AcrossComments: false
40+
# AlignCaseColons: false
1441
# AlignEscapedNewlines: Right
15-
AlignOperands: DontAlign
16-
AlignTrailingComments: false
42+
AlignOperands: DontAlign
43+
AlignTrailingComments:
44+
Kind: Never
45+
OverEmptyLines: 0
1746
# AllowAllArgumentsOnNextLine: true
1847
AllowAllParametersOfDeclarationOnNextLine: false
19-
# AllowShortEnumsOnASingleLine: true
48+
# AllowBreakBeforeNoexceptSpecifier: Never
2049
# AllowShortBlocksOnASingleLine: Never
2150
# AllowShortCaseLabelsOnASingleLine: false
51+
# AllowShortCompoundRequirementOnASingleLine: true
52+
# AllowShortEnumsOnASingleLine: true
2253
# AllowShortFunctionsOnASingleLine: All
23-
# AllowShortLambdasOnASingleLine: All
2454
# AllowShortIfStatementsOnASingleLine: Never
55+
# AllowShortLambdasOnASingleLine: All
2556
# AllowShortLoopsOnASingleLine: false
26-
# AlwaysBreakAfterDefinitionReturnType: None
2757
# AlwaysBreakAfterReturnType: None
2858
# AlwaysBreakBeforeMultilineStrings: false
2959
# AlwaysBreakTemplateDeclarations: MultiLine
3060
# AttributeMacros:
3161
# - __capability
3262
# BinPackArguments: true
3363
# BinPackParameters: true
64+
# BitFieldColonSpacing: Both
3465
# BraceWrapping:
35-
# AfterCaseLabel: false
36-
# AfterClass: false
66+
# AfterCaseLabel: false
67+
# AfterClass: false
3768
# AfterControlStatement: Never
38-
# AfterEnum: false
39-
# AfterFunction: false
40-
# AfterNamespace: false
69+
# AfterEnum: false
70+
# AfterFunction: false
71+
# AfterNamespace: false
4172
# AfterObjCDeclaration: false
42-
# AfterStruct: false
43-
# AfterUnion: false
73+
# AfterStruct: false
74+
# AfterUnion: false
4475
# AfterExternBlock: false
45-
# BeforeCatch: false
46-
# BeforeElse: false
76+
# BeforeCatch: false
77+
# BeforeElse: false
4778
# BeforeLambdaBody: false
48-
# BeforeWhile: false
49-
# IndentBraces: false
79+
# BeforeWhile: false
80+
# IndentBraces: false
5081
# SplitEmptyFunction: true
5182
# SplitEmptyRecord: true
5283
# SplitEmptyNamespace: true
84+
# BreakAdjacentStringLiterals: true
85+
# BreakAfterAttributes: Leave
86+
# BreakAfterJavaFieldAnnotations: false
87+
# BreakArrays: true
5388
# BreakBeforeBinaryOperators: None
54-
# BreakBeforeConceptDeclarations: true
5589
# BreakBeforeBraces: Attach
56-
# BreakBeforeInheritanceComma: false
57-
# BreakInheritanceList: BeforeColon
90+
# BreakBeforeConceptDeclarations: Always
91+
# BreakBeforeInlineASMColon: OnlyMultiline
5892
# BreakBeforeTernaryOperators: true
59-
# BreakConstructorInitializersBeforeComma: false
6093
BreakConstructorInitializers: AfterColon
94+
# BreakInheritanceList: BeforeColon
6195
# BreakStringLiterals: true
62-
ColumnLimit: 0
63-
# CommentPragmas: '^ IWYU pragma:'
64-
# QualifierAlignment: Leave
96+
ColumnLimit: 0
97+
# CommentPragmas: '^ IWYU pragma:'
6598
# CompactNamespaces: false
6699
ConstructorInitializerIndentWidth: 8
67100
ContinuationIndentWidth: 8
68101
Cpp11BracedListStyle: false
69-
# DeriveLineEnding: true
70102
# DerivePointerAlignment: false
71-
# DisableFormat: false
103+
# DisableFormat: false
72104
# EmptyLineAfterAccessModifier: Never
73105
# EmptyLineBeforeAccessModifier: LogicalBlock
74106
# ExperimentalAutoDetectBinPacking: false
75-
# PackConstructorInitializers: BinPack
76-
ConstructorInitializerAllOnOneLineOrOnePerLine: true
77-
# AllowAllConstructorInitializersOnNextLine: true
78107
# FixNamespaceComments: true
79108
# ForEachMacros:
80109
# - foreach
81110
# - Q_FOREACH
82111
# - BOOST_FOREACH
83112
# IfMacros:
84113
# - KJ_IF_MAYBE
85-
# IncludeBlocks: Preserve
114+
# IncludeBlocks: Preserve
86115
IncludeCategories:
87-
- Regex: '".*"'
88-
Priority: 1
89-
- Regex: '^<.*\.h>'
90-
Priority: 2
91-
- Regex: '^<.*'
92-
Priority: 3
93-
# IncludeIsMainRegex: '(Test)?$'
116+
- Regex: ^".*"$
117+
Priority: 1
118+
- Regex: ^<.*\.h>$
119+
Priority: 2
120+
- Regex: ^<.*>$
121+
Priority: 3
122+
# IncludeIsMainRegex: (Test)?$
94123
# IncludeIsMainSourceRegex: ''
95124
# IndentAccessModifiers: false
96-
IndentCaseLabels: true
97125
# IndentCaseBlocks: false
126+
IndentCaseLabels: true
127+
# IndentExternBlock: AfterExternBlock
98128
# IndentGotoLabels: true
99129
# IndentPPDirectives: None
100-
# IndentExternBlock: AfterExternBlock
101-
# IndentRequires: false
102-
IndentWidth: 4
130+
# IndentRequiresClause: true
131+
IndentWidth: 4
103132
# IndentWrappedFunctionNames: false
133+
# InsertBraces: false
134+
# InsertNewlineAtEOF: false
104135
# InsertTrailingCommas: None
136+
# IntegerLiteralSeparator:
137+
# Binary: 0
138+
# BinaryMinDigits: 0
139+
# Decimal: 0
140+
# DecimalMinDigits: 0
141+
# Hex: 0
142+
# HexMinDigits: 0
143+
JavaImportGroups:
144+
- org.godotengine
145+
- android
146+
- androidx
147+
- com.android
148+
- com.google
149+
- java
150+
- javax
105151
# JavaScriptQuotes: Leave
106152
# JavaScriptWrapImports: true
153+
# KeepEmptyLinesAtEOF: false
107154
KeepEmptyLinesAtTheStartOfBlocks: false
108155
# LambdaBodyIndentation: Signature
156+
# Language: Cpp
157+
# LineEnding: DeriveLF
109158
# MacroBlockBegin: ''
110-
# MacroBlockEnd: ''
159+
# MacroBlockEnd: ''
111160
# MaxEmptyLinesToKeep: 1
112161
# NamespaceIndentation: None
162+
# ObjCBinPackProtocolList: Auto
163+
ObjCBlockIndentWidth: 4
164+
# ObjCBreakBeforeNestedBlockParam: true
165+
# ObjCSpaceAfterProperty: false
166+
# ObjCSpaceBeforeProtocolList: true
167+
# PPIndentWidth: -1
168+
PackConstructorInitializers: NextLine
113169
# PenaltyBreakAssignment: 2
114170
# PenaltyBreakBeforeFirstCallParameter: 19
115171
# PenaltyBreakComment: 300
116172
# PenaltyBreakFirstLessLess: 120
117173
# PenaltyBreakOpenParenthesis: 0
174+
# PenaltyBreakScopeResolution: 500
118175
# PenaltyBreakString: 1000
119176
# PenaltyBreakTemplateDeclaration: 10
120177
# PenaltyExcessCharacter: 1000000
121-
# PenaltyReturnTypeOnItsOwnLine: 60
122178
# PenaltyIndentedWhitespace: 0
179+
# PenaltyReturnTypeOnItsOwnLine: 60
123180
# PointerAlignment: Right
124-
# PPIndentWidth: -1
181+
# QualifierAlignment: Leave
125182
# ReferenceAlignment: Pointer
126-
# ReflowComments: true
183+
# ReflowComments: true
127184
# RemoveBracesLLVM: false
185+
# RemoveParentheses: Leave
186+
# RemoveSemicolon: false
187+
# RequiresClausePosition: OwnLine
188+
# RequiresExpressionIndentation: OuterScope
128189
# SeparateDefinitionBlocks: Leave
129190
# ShortNamespaceLines: 1
130-
# SortIncludes: CaseSensitive
191+
# SkipMacroDefinitionBody: false
192+
# SortIncludes: CaseSensitive
131193
# SortJavaStaticImport: Before
132-
# SortUsingDeclarations: true
194+
# SortUsingDeclarations: LexicographicNumeric
133195
# SpaceAfterCStyleCast: false
134196
# SpaceAfterLogicalNot: false
135197
# SpaceAfterTemplateKeyword: true
198+
# SpaceAroundPointerQualifiers: Default
136199
# SpaceBeforeAssignmentOperators: true
137200
# SpaceBeforeCaseColon: false
138201
# SpaceBeforeCpp11BracedList: false
139202
# SpaceBeforeCtorInitializerColon: true
140203
# SpaceBeforeInheritanceColon: true
141-
# SpaceBeforeParens: ControlStatements
204+
# SpaceBeforeJsonColon: false
142205
# SpaceBeforeParensOptions:
143206
# AfterControlStatements: true
144207
# AfterForeachMacros: true
145-
# AfterFunctionDefinitionName: false
146208
# AfterFunctionDeclarationName: false
147-
# AfterIfMacros: true
209+
# AfterFunctionDefinitionName: false
210+
# AfterIfMacros: true
148211
# AfterOverloadedOperator: false
212+
# AfterPlacementOperator: true
213+
# AfterRequiresInClause: false
214+
# AfterRequiresInExpression: false
149215
# BeforeNonEmptyParentheses: false
150-
# SpaceAroundPointerQualifiers: Default
151216
# SpaceBeforeRangeBasedForLoopColon: true
217+
# SpaceBeforeSquareBrackets: false
152218
# SpaceInEmptyBlock: false
153-
# SpaceInEmptyParentheses: false
154219
# SpacesBeforeTrailingComments: 1
155-
# SpacesInAngles: Never
156-
# SpacesInConditionalStatement: false
220+
# SpacesInAngles: Never
157221
# SpacesInContainerLiterals: true
158-
# SpacesInCStyleCastParentheses: false
159222
## Godot TODO: We'll want to use a min of 1, but we need to see how to fix
160223
## our comment capitalization at the same time.
161224
SpacesInLineCommentPrefix:
162-
Minimum: 0
163-
Maximum: -1
164-
# SpacesInParentheses: false
225+
Minimum: 0
226+
Maximum: -1
227+
# SpacesInParens: Never
228+
# SpacesInParensOptions:
229+
# InConditionalStatements: false
230+
# InCStyleCasts: false
231+
# InEmptyParentheses: false
232+
# Other: false
165233
# SpacesInSquareBrackets: false
166-
# SpaceBeforeSquareBrackets: false
167-
# BitFieldColonSpacing: Both
234+
Standard: c++17
168235
# StatementAttributeLikeMacros:
169236
# - Q_EMIT
170237
# StatementMacros:
171238
# - Q_UNUSED
172239
# - QT_REQUIRE_VERSION
173-
TabWidth: 4
174-
# UseCRLF: false
175-
UseTab: Always
240+
TabWidth: 4
241+
UseTab: Always
242+
# VerilogBreakBetweenInstancePorts: true
176243
# WhitespaceSensitiveMacros:
177-
# - STRINGIZE
178-
# - PP_STRINGIZE
179244
# - BOOST_PP_STRINGIZE
180-
# - NS_SWIFT_NAME
181245
# - 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-
...
246+
# - NS_SWIFT_NAME
247+
# - PP_STRINGIZE
248+
# - STRINGIZE

.git-blame-ignore-revs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,6 @@ df61dc4b2bd54a5a40c515493c76f5a458e5b541
5454

5555
# Enforce template syntax `typename` over `class`
5656
9903e6779b70fc03aae70a37b9cf053f4f355b91
57+
58+
# Style: Apply new `clang-format` fixes
59+
b37fc1014abf7adda70dc30b0822d775b3a4433f

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ exclude: |
99
1010
repos:
1111
- repo: https://github.com/pre-commit/mirrors-clang-format
12-
rev: v17.0.6
12+
rev: v18.1.8
1313
hooks:
1414
- id: clang-format
1515
files: \.(c|h|cpp|hpp|cc|hh|cxx|hxx|m|mm|inc|java|glsl)$

drivers/gles3/shaders/sky.glsl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,7 @@ void main() {
212212
#endif
213213

214214
{
215-
216215
#CODE : SKY
217-
218216
}
219217

220218
color *= sky_energy_multiplier;

drivers/gles3/storage/render_scene_buffers_gles3.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ class RenderSceneBuffersGLES3 : public RenderSceneBuffers {
103103
virtual void configure(const RenderSceneBuffersConfiguration *p_config) override;
104104
void configure_for_probe(Size2i p_size);
105105

106-
virtual void set_fsr_sharpness(float p_fsr_sharpness) override{};
107-
virtual void set_texture_mipmap_bias(float p_texture_mipmap_bias) override{};
108-
virtual void set_use_debanding(bool p_use_debanding) override{};
106+
virtual void set_fsr_sharpness(float p_fsr_sharpness) override {}
107+
virtual void set_texture_mipmap_bias(float p_texture_mipmap_bias) override {}
108+
virtual void set_use_debanding(bool p_use_debanding) override {}
109109
void set_apply_color_adjustments_in_post(bool p_apply_in_post);
110110

111111
void free_render_buffer_data();

drivers/gles3/storage/texture_storage.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ class TextureStorage : public RendererTextureStorage {
582582

583583
virtual RID decal_allocate() override;
584584
virtual void decal_initialize(RID p_rid) override;
585-
virtual void decal_free(RID p_rid) override{};
585+
virtual void decal_free(RID p_rid) override {}
586586

587587
virtual void decal_set_size(RID p_decal, const Vector3 &p_size) override;
588588
virtual void decal_set_texture(RID p_decal, RS::DecalTexture p_type, RID p_texture) override;

editor/editor_resource_preview.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class EditorResourcePreviewGenerator : public RefCounted {
6565
virtual bool handles(const String &p_type) const;
6666
virtual Ref<Texture2D> generate(const Ref<Resource> &p_from, const Size2 &p_size, Dictionary &p_metadata) const;
6767
virtual Ref<Texture2D> generate_from_path(const String &p_path, const Size2 &p_size, Dictionary &p_metadata) const;
68-
virtual void abort(){};
68+
virtual void abort() {}
6969

7070
virtual bool generate_small_preview_automatically() const;
7171
virtual bool can_generate_small_preview() const;

0 commit comments

Comments
 (0)