From ef0dd99a37f3d9e6c0a45b363a1fa13272aaf510 Mon Sep 17 00:00:00 2001 From: Thaddeus Crews Date: Sat, 27 Sep 2025 10:28:44 -0500 Subject: [PATCH] CI: Bump `clang-format` and `clang-tidy` versions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • clang-format: 20.1.0 → 21.1.7 • clang-tidy: 20.1.0 → 21.1.6 • `.clang-format`: 17.0.6 → 18.1.8 (keep 3 versions behind latest for compatibility) --- .clang-format | 14 +++++++++-- .pre-commit-config.yaml | 4 ++-- .../renderer_rd/effects/debug_effects.cpp | 4 ++-- servers/rendering/rendering_light_culler.cpp | 24 +++++++++---------- tests/core/io/test_marshalls.h | 4 ++-- 5 files changed, 30 insertions(+), 20 deletions(-) diff --git a/.clang-format b/.clang-format index 87731d9eb83..22966e2db93 100644 --- a/.clang-format +++ b/.clang-format @@ -1,6 +1,6 @@ # 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 -# chosen value in case the base style changes (last sync: Clang 17.0.6). +# chosen value in case the base style changes (last sync: Clang 18.1.8). BasedOnStyle: LLVM AccessModifierOffset: -4 AlignAfterOpenBracket: DontAlign @@ -10,24 +10,28 @@ AlignAfterOpenBracket: DontAlign # AcrossEmptyLines: false # AcrossComments: false # AlignCompound: false +# AlignFunctionPointers: false # PadOperators: true # AlignConsecutiveBitFields: # Enabled: false # AcrossEmptyLines: false # AcrossComments: false # AlignCompound: false +# AlignFunctionPointers: false # PadOperators: false # AlignConsecutiveDeclarations: # Enabled: false # AcrossEmptyLines: false # AcrossComments: false # AlignCompound: false +# AlignFunctionPointers: false # PadOperators: false # AlignConsecutiveMacros: # Enabled: false # AcrossEmptyLines: false # AcrossComments: false # AlignCompound: false +# AlignFunctionPointers: false # PadOperators: false # AlignConsecutiveShortCaseStatements: # Enabled: false @@ -41,8 +45,10 @@ AlignTrailingComments: OverEmptyLines: 0 # AllowAllArgumentsOnNextLine: true AllowAllParametersOfDeclarationOnNextLine: false +# AllowBreakBeforeNoexceptSpecifier: Never # AllowShortBlocksOnASingleLine: Never # AllowShortCaseLabelsOnASingleLine: false +# AllowShortCompoundRequirementOnASingleLine: true # AllowShortEnumsOnASingleLine: true AllowShortFunctionsOnASingleLine: Inline # AllowShortIfStatementsOnASingleLine: Never @@ -78,7 +84,8 @@ AttributeMacros: # SplitEmptyFunction: true # SplitEmptyRecord: true # SplitEmptyNamespace: true -# BreakAfterAttributes: Never +# BreakAdjacentStringLiterals: true +# BreakAfterAttributes: Leave # BreakAfterJavaFieldAnnotations: false # BreakArrays: true # BreakBeforeBinaryOperators: None @@ -167,6 +174,7 @@ PackConstructorInitializers: NextLine # PenaltyBreakComment: 300 # PenaltyBreakFirstLessLess: 120 # PenaltyBreakOpenParenthesis: 0 +# PenaltyBreakScopeResolution: 500 # PenaltyBreakString: 1000 # PenaltyBreakTemplateDeclaration: 10 # PenaltyExcessCharacter: 1000000 @@ -183,6 +191,7 @@ RemoveSemicolon: true # RequiresExpressionIndentation: OuterScope # SeparateDefinitionBlocks: Leave # ShortNamespaceLines: 1 +# SkipMacroDefinitionBody: false # SortIncludes: CaseSensitive # SortJavaStaticImport: Before # SortUsingDeclarations: LexicographicNumeric @@ -204,6 +213,7 @@ RemoveSemicolon: true # AfterFunctionDefinitionName: false # AfterIfMacros: true # AfterOverloadedOperator: false +# AfterPlacementOperator: true # AfterRequiresInClause: false # AfterRequiresInExpression: false # BeforeNonEmptyParentheses: false diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 22616f7531d..95b5c1ed52d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,7 +11,7 @@ exclude: | repos: - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v20.1.0 + rev: v21.1.7 hooks: - id: clang-format files: \.(c|h|cpp|hpp|cc|hh|cxx|hxx|m|mm|inc|java)$ @@ -29,7 +29,7 @@ repos: files: \.(c|h|cpp|hpp|cc|hh|cxx|hxx|m|mm|inc|java|glsl)$ args: [--fix, --quiet, --use-color] types_or: [text] - additional_dependencies: [clang-tidy==20.1.0] + additional_dependencies: [clang-tidy==21.1.6] require_serial: true stages: [manual] # Not automatically triggered, invoked via `pre-commit run --hook-stage manual clang-tidy` diff --git a/servers/rendering/renderer_rd/effects/debug_effects.cpp b/servers/rendering/renderer_rd/effects/debug_effects.cpp index 8946659fa75..64286cde08d 100644 --- a/servers/rendering/renderer_rd/effects/debug_effects.cpp +++ b/servers/rendering/renderer_rd/effects/debug_effects.cpp @@ -102,7 +102,7 @@ void DebugEffects::_create_frustum_arrays() { 2, 6, 4, // FRT, NRT, NLT // Bottom 5, 7, 1, // NLB, NRB, FLB, - 7, 3, 1, // NRB, FRB, FLB + 7, 3, 1 // NRB, FRB, FLB }; // Create our index_array @@ -136,7 +136,7 @@ void DebugEffects::_create_frustum_arrays() { 0, 4, // FLT - NLT 1, 5, // FLB - NLB 2, 6, // FRT - NRT - 3, 7, // FRB - NRB + 3, 7 // FRB - NRB }; // Create our lines_array diff --git a/servers/rendering/rendering_light_culler.cpp b/servers/rendering/rendering_light_culler.cpp index d70433006d8..962e70c76f1 100644 --- a/servers/rendering/rendering_light_culler.cpp +++ b/servers/rendering/rendering_light_culler.cpp @@ -932,11 +932,11 @@ void RenderingLightCuller::get_corners_of_planes(PlaneOrder p_plane_a, PlaneOrde // LSM_FP_NEAR { // LSM_FP_NEAR - PT_NEAR_LEFT_TOP, PT_NEAR_RIGHT_TOP, // Invalid combination. + PT_NEAR_LEFT_TOP, PT_NEAR_RIGHT_TOP // Invalid combination. }, { // LSM_FP_FAR - PT_FAR_RIGHT_TOP, PT_FAR_LEFT_TOP, // Invalid combination. + PT_FAR_RIGHT_TOP, PT_FAR_LEFT_TOP // Invalid combination. }, { // LSM_FP_LEFT @@ -964,11 +964,11 @@ void RenderingLightCuller::get_corners_of_planes(PlaneOrder p_plane_a, PlaneOrde // LSM_FP_FAR { // LSM_FP_NEAR - PT_FAR_LEFT_TOP, PT_FAR_RIGHT_TOP, // Invalid combination. + PT_FAR_LEFT_TOP, PT_FAR_RIGHT_TOP // Invalid combination. }, { // LSM_FP_FAR - PT_FAR_RIGHT_TOP, PT_FAR_LEFT_TOP, // Invalid combination. + PT_FAR_RIGHT_TOP, PT_FAR_LEFT_TOP // Invalid combination. }, { // LSM_FP_LEFT @@ -1006,7 +1006,7 @@ void RenderingLightCuller::get_corners_of_planes(PlaneOrder p_plane_a, PlaneOrde }, { // LSM_FP_LEFT - PT_FAR_LEFT_BOTTOM, PT_FAR_LEFT_BOTTOM, // Invalid combination. + PT_FAR_LEFT_BOTTOM, PT_FAR_LEFT_BOTTOM // Invalid combination. }, { // LSM_FP_TOP @@ -1015,7 +1015,7 @@ void RenderingLightCuller::get_corners_of_planes(PlaneOrder p_plane_a, PlaneOrde }, { // LSM_FP_RIGHT - PT_FAR_LEFT_BOTTOM, PT_FAR_LEFT_BOTTOM, // Invalid combination. + PT_FAR_LEFT_BOTTOM, PT_FAR_LEFT_BOTTOM // Invalid combination. }, { // LSM_FP_BOTTOM @@ -1043,7 +1043,7 @@ void RenderingLightCuller::get_corners_of_planes(PlaneOrder p_plane_a, PlaneOrde }, { // LSM_FP_TOP - PT_NEAR_LEFT_TOP, PT_FAR_LEFT_TOP, // Invalid combination. + PT_NEAR_LEFT_TOP, PT_FAR_LEFT_TOP // Invalid combination. }, { // LSM_FP_RIGHT @@ -1052,7 +1052,7 @@ void RenderingLightCuller::get_corners_of_planes(PlaneOrder p_plane_a, PlaneOrde }, { // LSM_FP_BOTTOM - PT_FAR_LEFT_BOTTOM, PT_NEAR_LEFT_BOTTOM, // Invalid combination. + PT_FAR_LEFT_BOTTOM, PT_NEAR_LEFT_BOTTOM // Invalid combination. }, }, @@ -1070,7 +1070,7 @@ void RenderingLightCuller::get_corners_of_planes(PlaneOrder p_plane_a, PlaneOrde }, { // LSM_FP_LEFT - PT_FAR_RIGHT_BOTTOM, PT_FAR_RIGHT_BOTTOM, // Invalid combination. + PT_FAR_RIGHT_BOTTOM, PT_FAR_RIGHT_BOTTOM // Invalid combination. }, { // LSM_FP_TOP @@ -1079,7 +1079,7 @@ void RenderingLightCuller::get_corners_of_planes(PlaneOrder p_plane_a, PlaneOrde }, { // LSM_FP_RIGHT - PT_FAR_RIGHT_BOTTOM, PT_FAR_RIGHT_BOTTOM, // Invalid combination. + PT_FAR_RIGHT_BOTTOM, PT_FAR_RIGHT_BOTTOM // Invalid combination. }, { // LSM_FP_BOTTOM @@ -1116,7 +1116,7 @@ void RenderingLightCuller::get_corners_of_planes(PlaneOrder p_plane_a, PlaneOrde }, { // LSM_FP_TOP - PT_NEAR_LEFT_BOTTOM, PT_FAR_LEFT_BOTTOM, // Invalid combination. + PT_NEAR_LEFT_BOTTOM, PT_FAR_LEFT_BOTTOM // Invalid combination. }, { // LSM_FP_RIGHT @@ -1125,7 +1125,7 @@ void RenderingLightCuller::get_corners_of_planes(PlaneOrder p_plane_a, PlaneOrde }, { // LSM_FP_BOTTOM - PT_FAR_LEFT_BOTTOM, PT_NEAR_LEFT_BOTTOM, // Invalid combination. + PT_FAR_LEFT_BOTTOM, PT_NEAR_LEFT_BOTTOM // Invalid combination. }, }, diff --git a/tests/core/io/test_marshalls.h b/tests/core/io/test_marshalls.h index fdbea9fa4ed..d16a3ea5782 100644 --- a/tests/core/io/test_marshalls.h +++ b/tests/core/io/test_marshalls.h @@ -394,7 +394,7 @@ TEST_CASE("[Marshalls] Typed array decoding") { 0x02, 0x00, 0x00, 0x00, // Array type (Variant::INT). 0x01, 0x00, 0x00, 0x00, // Array size. 0x02, 0x00, 0x01, 0x00, // Element type (Variant::INT, HEADER_DATA_FLAG_64). - 0xef, 0xcd, 0xab, 0x89, 0x67, 0x45, 0x23, 0xf1, // Element value. + 0xef, 0xcd, 0xab, 0x89, 0x67, 0x45, 0x23, 0xf1 // Element value. }; CHECK(decode_variant(variant, buffer, 24, &r_len) == OK); @@ -475,7 +475,7 @@ TEST_CASE("[Marshalls] Typed dictionary decoding") { 0x02, 0x00, 0x01, 0x00, // Key type (Variant::INT, HEADER_DATA_FLAG_64). 0xef, 0xcd, 0xab, 0x89, 0x67, 0x45, 0x23, 0xf1, // Key value. 0x02, 0x00, 0x01, 0x00, // Value type (Variant::INT, HEADER_DATA_FLAG_64). - 0xef, 0xcd, 0xab, 0x89, 0x67, 0x45, 0x23, 0xf1, // Value value. + 0xef, 0xcd, 0xab, 0x89, 0x67, 0x45, 0x23, 0xf1 // Value value. }; CHECK(decode_variant(variant, buffer, 40, &r_len) == OK);