Переглянути джерело

Style: Minor pre-commit & `yaml` adjustments

Thaddeus Crews 6 місяців тому
батько
коміт
048f8442e3

+ 4 - 4
.clang-format

@@ -88,7 +88,7 @@ BreakConstructorInitializers: AfterColon
 # BreakInheritanceList: BeforeColon
 # BreakStringLiterals: true
 ColumnLimit: 0
-# CommentPragmas: '^ IWYU pragma:'
+# CommentPragmas: "^ IWYU pragma:"
 # CompactNamespaces: false
 ConstructorInitializerIndentWidth: 8
 ContinuationIndentWidth: 8
@@ -114,7 +114,7 @@ IncludeCategories:
   - Regex: ^<.*>$
     Priority: 3
 # IncludeIsMainRegex: (Test)?$
-# IncludeIsMainSourceRegex: ''
+# IncludeIsMainSourceRegex: ""
 # IndentAccessModifiers: false
 # IndentCaseBlocks: false
 IndentCaseLabels: true
@@ -149,8 +149,8 @@ KeepEmptyLinesAtTheStartOfBlocks: false
 # LambdaBodyIndentation: Signature
 # Language: Cpp
 # LineEnding: DeriveLF
-# MacroBlockBegin: ''
-# MacroBlockEnd: ''
+# MacroBlockBegin: ""
+# MacroBlockEnd: ""
 # MaxEmptyLinesToKeep: 1
 # NamespaceIndentation: None
 # ObjCBinPackProtocolList: Auto

+ 1 - 1
.clang-tidy

@@ -7,7 +7,7 @@ Checks:
   - modernize-use-nullptr
   - readability-braces-around-statements
   - readability-redundant-member-init
-HeaderFileExtensions: ['', h, hh, hpp, hxx, inc, glsl]
+HeaderFileExtensions: ["", h, hh, hpp, hxx, inc, glsl]
 ImplementationFileExtensions: [c, cc, cpp, cxx, m, mm, java]
 HeaderFilterRegex: (core|doc|drivers|editor|main|modules|platform|scene|servers|tests)/
 FormatStyle: file

+ 1 - 1
.github/actions/godot-build/action.yml

@@ -14,7 +14,7 @@ inputs:
     required: false
   sconsflags:
     description: Additional SCons flags.
-    default: ''
+    default: ""
     required: false
   scons-cache:
     description: The SCons cache path.

+ 2 - 2
.github/workflows/linux_builds.yml

@@ -129,7 +129,7 @@ jobs:
         continue-on-error: true
 
       - name: Setup Python and SCons
-        if: '!matrix.legacy-scons'
+        if: "!matrix.legacy-scons"
         uses: ./.github/actions/godot-deps
 
       - name: Setup Python and SCons (legacy versions)
@@ -150,7 +150,7 @@ jobs:
         uses: actions/setup-dotnet@v4
         with:
           # Targeting the oldest version we want to support to ensure it still builds.
-          dotnet-version: '8.0.100'
+          dotnet-version: 8.0.100
 
       - name: Compilation
         uses: ./.github/actions/godot-build

+ 1 - 1
.github/workflows/runner.yml

@@ -9,7 +9,7 @@ jobs:
   # First stage: Only static checks, fast and prevent expensive builds from running.
 
   static-checks:
-    if: '!vars.DISABLE_GODOT_CI'
+    if: "!vars.DISABLE_GODOT_CI"
     name: 📊 Static checks
     uses: ./.github/workflows/static_checks.yml
 

+ 27 - 49
.pre-commit-config.yaml

@@ -4,8 +4,10 @@ default_language_version:
 exclude: |
   (?x)^(
     .*thirdparty/.*|
-    .*-so_wrap\.(h|c)$
-  )
+    .*-so_wrap\.(h|c)|
+    platform/android/java/editor/src/main/java/com/android/.*|
+    platform/android/java/lib/src/com/google/.*
+  )$
 
 repos:
   - repo: https://github.com/pre-commit/mirrors-clang-format
@@ -14,23 +16,13 @@ repos:
       - id: clang-format
         files: \.(c|h|cpp|hpp|cc|hh|cxx|hxx|m|mm|inc|java)$
         types_or: [text]
-        exclude: |
-          (?x)^(
-            tests/python_build/.*|
-            platform/android/java/editor/src/main/java/com/android/.*|
-            platform/android/java/lib/src/com/.*
-          )
+        exclude: ^tests/python_build/.*
       - id: clang-format
         name: clang-format-glsl
         files: \.glsl$
         types_or: [text]
-        exclude: |
-          (?x)^(
-            tests/python_build/.*|
-            platform/android/java/editor/src/main/java/com/android/.*|
-            platform/android/java/lib/src/com/.*
-          )
-        args: ['-style=file:misc/utility/.clang-format-glsl']
+        exclude: ^tests/python_build/.*
+        args: [-style=file:misc/utility/clang_format_glsl.yml]
 
   - repo: https://github.com/pocc/pre-commit-hooks
     rev: v1.3.5
@@ -39,12 +31,7 @@ repos:
         files: \.(c|h|cpp|hpp|cc|hh|cxx|hxx|m|mm|inc|java|glsl)$
         args: [--fix, --quiet, --use-color]
         types_or: [text]
-        exclude: |
-          (?x)^(
-            tests/python_build/.*|
-            platform/android/java/editor/src/main/java/com/android/.*|
-            platform/android/java/lib/src/com/.*
-          )
+        exclude: ^tests/python_build/.*
         additional_dependencies: [clang-tidy==19.1.0]
         require_serial: true
         stages: [manual] # Not automatically triggered, invoked via `pre-commit run --hook-stage manual clang-tidy`
@@ -71,11 +58,6 @@ repos:
     rev: v2.3.0
     hooks:
       - id: codespell
-        exclude: |
-          (?x)^(
-            platform/android/java/editor/src/main/java/com/android/.*|
-            platform/android/java/lib/src/com/.*
-          )
         additional_dependencies: [tomli]
 
   ### Requires Docker; look into alternative implementation.
@@ -118,10 +100,10 @@ repos:
           - --config
           - platform/web/eslint.config.cjs
         additional_dependencies:
-          - '@eslint/js@^9.3.0'
-          - '@html-eslint/eslint-plugin@^0.24.1'
-          - '@html-eslint/parser@^0.24.1'
-          - '@stylistic/eslint-plugin@^2.1.0'
+          - "@eslint/js@^9.3.0"
+          - "@html-eslint/eslint-plugin@^0.24.1"
+          - "@html-eslint/parser@^0.24.1"
+          - "@stylistic/eslint-plugin@^2.1.0"
           - eslint@^9.3.0
           - eslint-plugin-html@^8.1.1
           - globals@^15.3.0
@@ -139,7 +121,7 @@ repos:
           - platform/web/js/engine/config.js
           - platform/web/js/engine/features.js
           - --destination
-          - ''
+          - ""
           - -d
           - dry-run
         pass_filenames: false
@@ -160,14 +142,12 @@ repos:
         files: \.(c|h|cpp|hpp|cc|hh|cxx|hxx|m|mm|inc|java)$
         exclude: |
           (?x)^(
-            core/math/bvh_.*\.inc$|
+            core/math/bvh_.*\.inc|
             platform/(?!android|ios|linuxbsd|macos|web|windows)\w+/.*|
-            platform/android/java/editor/src/main/java/com/android/.*|
-            platform/android/java/lib/src/com/.*|
-            platform/android/java/lib/src/org/godotengine/godot/gl/GLSurfaceView\.java$|
-            platform/android/java/lib/src/org/godotengine/godot/gl/EGLLogWrapper\.java$|
-            platform/android/java/lib/src/org/godotengine/godot/utils/ProcessPhoenix\.java$
-          )
+            platform/android/java/lib/src/org/godotengine/godot/gl/GLSurfaceView\.java|
+            platform/android/java/lib/src/org/godotengine/godot/gl/EGLLogWrapper\.java|
+            platform/android/java/lib/src/org/godotengine/godot/utils/ProcessPhoenix\.java
+          )$
 
       - id: header-guards
         name: header-guards
@@ -183,17 +163,15 @@ repos:
         types_or: [text]
         exclude: |
           (?x)^(
-            .*\.test\.txt$|
-            .*\.svg$|
-            .*\.patch$|
-            .*\.out$|
-            modules/gdscript/tests/scripts/parser/features/mixed_indentation_on_blank_lines\.gd$|
-            modules/gdscript/tests/scripts/parser/warnings/empty_file_newline_comment\.norun\.gd$|
-            modules/gdscript/tests/scripts/parser/warnings/empty_file_newline\.norun\.gd$|
-            platform/android/java/editor/src/main/java/com/android/.*|
-            platform/android/java/lib/src/com/google/.*|
-            tests/data/.*\.bin$
-          )
+            .*\.test\.txt|
+            .*\.svg|
+            .*\.patch|
+            .*\.out|
+            modules/gdscript/tests/scripts/parser/features/mixed_indentation_on_blank_lines\.gd|
+            modules/gdscript/tests/scripts/parser/warnings/empty_file_newline_comment\.norun\.gd|
+            modules/gdscript/tests/scripts/parser/warnings/empty_file_newline\.norun\.gd|
+            tests/data/.*\.bin
+          )$
 
       - id: dotnet-format
         name: dotnet-format

+ 0 - 0
misc/utility/.clang-format-glsl → misc/utility/clang_format_glsl.yml