ソースを参照

Merge pull request #99548 from Repiteo/style/clang-format-19-options

Style: Add 19.1.0 LLVM options to `.clang-format`
Thaddeus Crews 8 ヶ月 前
コミット
dcb59f0e7e

+ 35 - 8
.clang-format

@@ -1,6 +1,6 @@
 # Commented out parameters are those with the same value as base LLVM style.
 # Commented out parameters are those with the same value as base LLVM style.
 # We can uncomment them if we want to change their value, or enforce the
 # We can uncomment them if we want to change their value, or enforce the
-# chosen value in case the base style changes (last sync: Clang 18.1.8).
+# chosen value in case the base style changes (last sync: Clang 19.1.0).
 BasedOnStyle: LLVM
 BasedOnStyle: LLVM
 AccessModifierOffset: -4
 AccessModifierOffset: -4
 AlignAfterOpenBracket: DontAlign
 AlignAfterOpenBracket: DontAlign
@@ -37,7 +37,29 @@ AlignAfterOpenBracket: DontAlign
 #   Enabled: false
 #   Enabled: false
 #   AcrossEmptyLines: false
 #   AcrossEmptyLines: false
 #   AcrossComments: false
 #   AcrossComments: false
+#   AlignCaseArrows: false
 #   AlignCaseColons: false
 #   AlignCaseColons: false
+# AlignConsecutiveTableGenBreakingDAGArgColons:
+#   Enabled: false
+#   AcrossEmptyLines: false
+#   AcrossComments: false
+#   AlignCompound: false
+#   AlignFunctionPointers: false
+#   PadOperators: false
+# AlignConsecutiveTableGenCondOperatorColons:
+#   Enabled: false
+#   AcrossEmptyLines: false
+#   AcrossComments: false
+#   AlignCompound: false
+#   AlignFunctionPointers: false
+#   PadOperators: false
+# AlignConsecutiveTableGenDefinitionColons:
+#   Enabled: false
+#   AcrossEmptyLines: false
+#   AcrossComments: false
+#   AlignCompound: false
+#   AlignFunctionPointers: false
+#   PadOperators: false
 # AlignEscapedNewlines: Right
 # AlignEscapedNewlines: Right
 AlignOperands: DontAlign
 AlignOperands: DontAlign
 AlignTrailingComments:
 AlignTrailingComments:
@@ -47,6 +69,7 @@ AlignTrailingComments:
 AllowAllParametersOfDeclarationOnNextLine: false
 AllowAllParametersOfDeclarationOnNextLine: false
 # AllowBreakBeforeNoexceptSpecifier: Never
 # AllowBreakBeforeNoexceptSpecifier: Never
 # AllowShortBlocksOnASingleLine: Never
 # AllowShortBlocksOnASingleLine: Never
+# AllowShortCaseExpressionOnASingleLine: true
 # AllowShortCaseLabelsOnASingleLine: false
 # AllowShortCaseLabelsOnASingleLine: false
 # AllowShortCompoundRequirementOnASingleLine: true
 # AllowShortCompoundRequirementOnASingleLine: true
 # AllowShortEnumsOnASingleLine: true
 # AllowShortEnumsOnASingleLine: true
@@ -54,9 +77,7 @@ AllowAllParametersOfDeclarationOnNextLine: false
 # AllowShortIfStatementsOnASingleLine: Never
 # AllowShortIfStatementsOnASingleLine: Never
 # AllowShortLambdasOnASingleLine: All
 # AllowShortLambdasOnASingleLine: All
 # AllowShortLoopsOnASingleLine: false
 # AllowShortLoopsOnASingleLine: false
-# AlwaysBreakAfterReturnType: None
 # AlwaysBreakBeforeMultilineStrings: false
 # AlwaysBreakBeforeMultilineStrings: false
-# AlwaysBreakTemplateDeclarations: MultiLine
 # AttributeMacros:
 # AttributeMacros:
 #   - __capability
 #   - __capability
 # BinPackArguments: true
 # BinPackArguments: true
@@ -84,6 +105,7 @@ AllowAllParametersOfDeclarationOnNextLine: false
 # BreakAdjacentStringLiterals: true
 # BreakAdjacentStringLiterals: true
 # BreakAfterAttributes: Leave
 # BreakAfterAttributes: Leave
 # BreakAfterJavaFieldAnnotations: false
 # BreakAfterJavaFieldAnnotations: false
+# BreakAfterReturnType: None
 # BreakArrays: true
 # BreakArrays: true
 # BreakBeforeBinaryOperators: None
 # BreakBeforeBinaryOperators: None
 # BreakBeforeBraces: Attach
 # BreakBeforeBraces: Attach
@@ -91,8 +113,10 @@ AllowAllParametersOfDeclarationOnNextLine: false
 # BreakBeforeInlineASMColon: OnlyMultiline
 # BreakBeforeInlineASMColon: OnlyMultiline
 # BreakBeforeTernaryOperators: true
 # BreakBeforeTernaryOperators: true
 BreakConstructorInitializers: AfterColon
 BreakConstructorInitializers: AfterColon
+# BreakFunctionDefinitionParameters: false
 # BreakInheritanceList: BeforeColon
 # BreakInheritanceList: BeforeColon
 # BreakStringLiterals: true
 # BreakStringLiterals: true
+# BreakTemplateDeclarations: MultiLine
 ColumnLimit: 0
 ColumnLimit: 0
 # CommentPragmas: '^ IWYU pragma:'
 # CommentPragmas: '^ IWYU pragma:'
 # CompactNamespaces: false
 # CompactNamespaces: false
@@ -150,13 +174,16 @@ JavaImportGroups:
   - javax
   - javax
 # JavaScriptQuotes: Leave
 # JavaScriptQuotes: Leave
 # JavaScriptWrapImports: true
 # JavaScriptWrapImports: true
-# KeepEmptyLinesAtEOF: false
-KeepEmptyLinesAtTheStartOfBlocks: false
+KeepEmptyLines:
+  AtEndOfFile: false
+  AtStartOfBlock: false
+  AtStartOfFile: false
 # LambdaBodyIndentation: Signature
 # LambdaBodyIndentation: Signature
 # Language: Cpp
 # Language: Cpp
 # LineEnding: DeriveLF
 # LineEnding: DeriveLF
 # MacroBlockBegin: ''
 # MacroBlockBegin: ''
 # MacroBlockEnd: ''
 # MacroBlockEnd: ''
+# MainIncludeChar: Quote
 # MaxEmptyLinesToKeep: 1
 # MaxEmptyLinesToKeep: 1
 # NamespaceIndentation: None
 # NamespaceIndentation: None
 # ObjCBinPackProtocolList: Auto
 # ObjCBinPackProtocolList: Auto
@@ -219,13 +246,12 @@ RemoveSemicolon: true
 # SpacesBeforeTrailingComments: 1
 # SpacesBeforeTrailingComments: 1
 # SpacesInAngles: Never
 # SpacesInAngles: Never
 # SpacesInContainerLiterals: true
 # SpacesInContainerLiterals: true
-## Godot TODO: We'll want to use a min of 1, but we need to see how to fix
-## our comment capitalization at the same time.
 SpacesInLineCommentPrefix:
 SpacesInLineCommentPrefix:
-  Minimum: 0
+  Minimum: 0 # We want a minimum of 1 for comments, but allow 0 for disabled code.
   Maximum: -1
   Maximum: -1
 # SpacesInParens: Never
 # SpacesInParens: Never
 # SpacesInParensOptions:
 # SpacesInParensOptions:
+#   ExceptDoubleParentheses: false
 #   InConditionalStatements: false
 #   InConditionalStatements: false
 #   InCStyleCasts: false
 #   InCStyleCasts: false
 #   InEmptyParentheses: false
 #   InEmptyParentheses: false
@@ -238,6 +264,7 @@ Standard: c++20
 #   - Q_UNUSED
 #   - Q_UNUSED
 #   - QT_REQUIRE_VERSION
 #   - QT_REQUIRE_VERSION
 TabWidth: 4
 TabWidth: 4
+# TableGenBreakInsideDAGArg: DontBreak
 UseTab: Always
 UseTab: Always
 # VerilogBreakBetweenInstancePorts: true
 # VerilogBreakBetweenInstancePorts: true
 # WhitespaceSensitiveMacros:
 # WhitespaceSensitiveMacros:

+ 0 - 1
core/math/bvh_logic.inc

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

+ 0 - 1
core/math/bvh_misc.inc

@@ -1,4 +1,3 @@
-
 int _handle_get_tree_id(BVHHandle p_handle) const {
 int _handle_get_tree_id(BVHHandle p_handle) const {
 	if (USE_PAIRS) {
 	if (USE_PAIRS) {
 		return _extra[p_handle.id()].tree_id;
 		return _extra[p_handle.id()].tree_id;

+ 0 - 1
core/math/bvh_structs.inc

@@ -1,4 +1,3 @@
-
 public:
 public:
 struct ItemRef {
 struct ItemRef {
 	uint32_t tnode_id; // -1 is invalid
 	uint32_t tnode_id; // -1 is invalid

+ 0 - 1
drivers/gles3/shaders/canvas_uniforms_inc.glsl

@@ -1,4 +1,3 @@
-
 #define MAX_LIGHTS_PER_ITEM uint(16)
 #define MAX_LIGHTS_PER_ITEM uint(16)
 
 
 #define M_PI 3.14159265359
 #define M_PI 3.14159265359

+ 4 - 1
misc/utility/.clang-format-glsl

@@ -30,7 +30,10 @@ JavaImportGroups:
   - com.google
   - com.google
   - java
   - java
   - javax
   - javax
-KeepEmptyLinesAtTheStartOfBlocks: false
+KeepEmptyLines:
+  AtEndOfFile: false
+  AtStartOfBlock: false
+  AtStartOfFile: false
 ObjCBlockIndentWidth: 4
 ObjCBlockIndentWidth: 4
 PackConstructorInitializers: NextLine
 PackConstructorInitializers: NextLine
 RemoveSemicolon: false # Differs from base .clang-format
 RemoveSemicolon: false # Differs from base .clang-format

+ 0 - 1
modules/betsy/CrossPlatformSettings_piece_all.glsl

@@ -1,4 +1,3 @@
-
 #define min3(a, b, c) min(a, min(b, c))
 #define min3(a, b, c) min(a, min(b, c))
 #define max3(a, b, c) max(a, max(b, c))
 #define max3(a, b, c) max(a, max(b, c))
 
 

+ 0 - 1
modules/betsy/UavCrossPlatform_piece_all.glsl

@@ -1,4 +1,3 @@
-
 #define OGRE_imageLoad2D(inImage, iuv) imageLoad(inImage, int2(iuv))
 #define OGRE_imageLoad2D(inImage, iuv) imageLoad(inImage, int2(iuv))
 #define OGRE_imageLoad2DArray(inImage, iuvw) imageLoad(inImage, int3(iuvw))
 #define OGRE_imageLoad2DArray(inImage, iuvw) imageLoad(inImage, int3(iuvw))
 
 

+ 0 - 1
modules/lightmapper_rd/lm_common_inc.glsl

@@ -1,4 +1,3 @@
-
 /* SET 0, static data that does not change between any call */
 /* SET 0, static data that does not change between any call */
 
 
 layout(set = 0, binding = 0) uniform BakeParameters {
 layout(set = 0, binding = 0) uniform BakeParameters {

+ 0 - 1
servers/rendering/renderer_rd/shaders/canvas_uniforms_inc.glsl

@@ -1,4 +1,3 @@
-
 #define MAX_LIGHTS_PER_ITEM 16
 #define MAX_LIGHTS_PER_ITEM 16
 
 
 #define M_PI 3.14159265359
 #define M_PI 3.14159265359

+ 0 - 1
servers/rendering/renderer_rd/shaders/decal_data_inc.glsl

@@ -1,4 +1,3 @@
-
 struct DecalData {
 struct DecalData {
 	highp mat4 xform; //to decal transform
 	highp mat4 xform; //to decal transform
 	highp vec3 inv_extents;
 	highp vec3 inv_extents;

+ 0 - 1
servers/rendering/renderer_rd/shaders/effects/luminance_reduce_raster_inc.glsl

@@ -1,4 +1,3 @@
-
 layout(push_constant, std430) uniform PushConstant {
 layout(push_constant, std430) uniform PushConstant {
 	ivec2 source_size;
 	ivec2 source_size;
 	ivec2 dest_size;
 	ivec2 dest_size;