Skip to content

Commit dcb59f0

Browse files
committed
Merge pull request #99548 from Repiteo/style/clang-format-19-options
Style: Add 19.1.0 LLVM options to `.clang-format`
2 parents 2adfa20 + e8a4b45 commit dcb59f0

12 files changed

+39
-19
lines changed

.clang-format

+35-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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 18.1.8).
3+
# chosen value in case the base style changes (last sync: Clang 19.1.0).
44
BasedOnStyle: LLVM
55
AccessModifierOffset: -4
66
AlignAfterOpenBracket: DontAlign
@@ -37,7 +37,29 @@ AlignAfterOpenBracket: DontAlign
3737
# Enabled: false
3838
# AcrossEmptyLines: false
3939
# AcrossComments: false
40+
# AlignCaseArrows: false
4041
# AlignCaseColons: false
42+
# AlignConsecutiveTableGenBreakingDAGArgColons:
43+
# Enabled: false
44+
# AcrossEmptyLines: false
45+
# AcrossComments: false
46+
# AlignCompound: false
47+
# AlignFunctionPointers: false
48+
# PadOperators: false
49+
# AlignConsecutiveTableGenCondOperatorColons:
50+
# Enabled: false
51+
# AcrossEmptyLines: false
52+
# AcrossComments: false
53+
# AlignCompound: false
54+
# AlignFunctionPointers: false
55+
# PadOperators: false
56+
# AlignConsecutiveTableGenDefinitionColons:
57+
# Enabled: false
58+
# AcrossEmptyLines: false
59+
# AcrossComments: false
60+
# AlignCompound: false
61+
# AlignFunctionPointers: false
62+
# PadOperators: false
4163
# AlignEscapedNewlines: Right
4264
AlignOperands: DontAlign
4365
AlignTrailingComments:
@@ -47,16 +69,15 @@ AlignTrailingComments:
4769
AllowAllParametersOfDeclarationOnNextLine: false
4870
# AllowBreakBeforeNoexceptSpecifier: Never
4971
# AllowShortBlocksOnASingleLine: Never
72+
# AllowShortCaseExpressionOnASingleLine: true
5073
# AllowShortCaseLabelsOnASingleLine: false
5174
# AllowShortCompoundRequirementOnASingleLine: true
5275
# AllowShortEnumsOnASingleLine: true
5376
# AllowShortFunctionsOnASingleLine: All
5477
# AllowShortIfStatementsOnASingleLine: Never
5578
# AllowShortLambdasOnASingleLine: All
5679
# AllowShortLoopsOnASingleLine: false
57-
# AlwaysBreakAfterReturnType: None
5880
# AlwaysBreakBeforeMultilineStrings: false
59-
# AlwaysBreakTemplateDeclarations: MultiLine
6081
# AttributeMacros:
6182
# - __capability
6283
# BinPackArguments: true
@@ -84,15 +105,18 @@ AllowAllParametersOfDeclarationOnNextLine: false
84105
# BreakAdjacentStringLiterals: true
85106
# BreakAfterAttributes: Leave
86107
# BreakAfterJavaFieldAnnotations: false
108+
# BreakAfterReturnType: None
87109
# BreakArrays: true
88110
# BreakBeforeBinaryOperators: None
89111
# BreakBeforeBraces: Attach
90112
# BreakBeforeConceptDeclarations: Always
91113
# BreakBeforeInlineASMColon: OnlyMultiline
92114
# BreakBeforeTernaryOperators: true
93115
BreakConstructorInitializers: AfterColon
116+
# BreakFunctionDefinitionParameters: false
94117
# BreakInheritanceList: BeforeColon
95118
# BreakStringLiterals: true
119+
# BreakTemplateDeclarations: MultiLine
96120
ColumnLimit: 0
97121
# CommentPragmas: '^ IWYU pragma:'
98122
# CompactNamespaces: false
@@ -150,13 +174,16 @@ JavaImportGroups:
150174
- javax
151175
# JavaScriptQuotes: Leave
152176
# JavaScriptWrapImports: true
153-
# KeepEmptyLinesAtEOF: false
154-
KeepEmptyLinesAtTheStartOfBlocks: false
177+
KeepEmptyLines:
178+
AtEndOfFile: false
179+
AtStartOfBlock: false
180+
AtStartOfFile: false
155181
# LambdaBodyIndentation: Signature
156182
# Language: Cpp
157183
# LineEnding: DeriveLF
158184
# MacroBlockBegin: ''
159185
# MacroBlockEnd: ''
186+
# MainIncludeChar: Quote
160187
# MaxEmptyLinesToKeep: 1
161188
# NamespaceIndentation: None
162189
# ObjCBinPackProtocolList: Auto
@@ -219,13 +246,12 @@ RemoveSemicolon: true
219246
# SpacesBeforeTrailingComments: 1
220247
# SpacesInAngles: Never
221248
# SpacesInContainerLiterals: true
222-
## Godot TODO: We'll want to use a min of 1, but we need to see how to fix
223-
## our comment capitalization at the same time.
224249
SpacesInLineCommentPrefix:
225-
Minimum: 0
250+
Minimum: 0 # We want a minimum of 1 for comments, but allow 0 for disabled code.
226251
Maximum: -1
227252
# SpacesInParens: Never
228253
# SpacesInParensOptions:
254+
# ExceptDoubleParentheses: false
229255
# InConditionalStatements: false
230256
# InCStyleCasts: false
231257
# InEmptyParentheses: false
@@ -238,6 +264,7 @@ Standard: c++20
238264
# - Q_UNUSED
239265
# - QT_REQUIRE_VERSION
240266
TabWidth: 4
267+
# TableGenBreakInsideDAGArg: DontBreak
241268
UseTab: Always
242269
# VerilogBreakBetweenInstancePorts: true
243270
# WhitespaceSensitiveMacros:

core/math/bvh_logic.inc

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
// for slow incremental optimization, we will periodically remove each
32
// item from the tree and reinsert, to give it a chance to find a better position
43
void _logic_item_remove_and_reinsert(uint32_t p_ref_id) {

core/math/bvh_misc.inc

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
int _handle_get_tree_id(BVHHandle p_handle) const {
32
if (USE_PAIRS) {
43
return _extra[p_handle.id()].tree_id;

core/math/bvh_structs.inc

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
public:
32
struct ItemRef {
43
uint32_t tnode_id; // -1 is invalid

drivers/gles3/shaders/canvas_uniforms_inc.glsl

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
#define MAX_LIGHTS_PER_ITEM uint(16)
32

43
#define M_PI 3.14159265359

misc/utility/.clang-format-glsl

+4-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ JavaImportGroups:
3030
- com.google
3131
- java
3232
- javax
33-
KeepEmptyLinesAtTheStartOfBlocks: false
33+
KeepEmptyLines:
34+
AtEndOfFile: false
35+
AtStartOfBlock: false
36+
AtStartOfFile: false
3437
ObjCBlockIndentWidth: 4
3538
PackConstructorInitializers: NextLine
3639
RemoveSemicolon: false # Differs from base .clang-format

modules/betsy/CrossPlatformSettings_piece_all.glsl

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
#define min3(a, b, c) min(a, min(b, c))
32
#define max3(a, b, c) max(a, max(b, c))
43

modules/betsy/UavCrossPlatform_piece_all.glsl

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
#define OGRE_imageLoad2D(inImage, iuv) imageLoad(inImage, int2(iuv))
32
#define OGRE_imageLoad2DArray(inImage, iuvw) imageLoad(inImage, int3(iuvw))
43

modules/lightmapper_rd/lm_common_inc.glsl

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/* SET 0, static data that does not change between any call */
32

43
layout(set = 0, binding = 0) uniform BakeParameters {

servers/rendering/renderer_rd/shaders/canvas_uniforms_inc.glsl

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
#define MAX_LIGHTS_PER_ITEM 16
32

43
#define M_PI 3.14159265359

servers/rendering/renderer_rd/shaders/decal_data_inc.glsl

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
struct DecalData {
32
highp mat4 xform; //to decal transform
43
highp vec3 inv_extents;

servers/rendering/renderer_rd/shaders/effects/luminance_reduce_raster_inc.glsl

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
layout(push_constant, std430) uniform PushConstant {
32
ivec2 source_size;
43
ivec2 dest_size;

0 commit comments

Comments
 (0)