diff --git a/.clang-format b/.clang-format index 6ca04c43e77..dd0e5447d5f 100644 --- a/.clang-format +++ b/.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 diff --git a/.clang-tidy b/.clang-tidy index 1eb974f3f86..04c48cf8925 100644 --- a/.clang-tidy +++ b/.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 diff --git a/.github/actions/godot-build/action.yml b/.github/actions/godot-build/action.yml index ebc301dd0f4..2405cc22be2 100644 --- a/.github/actions/godot-build/action.yml +++ b/.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. diff --git a/.github/workflows/linux_builds.yml b/.github/workflows/linux_builds.yml index e5c28cab34b..2dc074d88b0 100644 --- a/.github/workflows/linux_builds.yml +++ b/.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 diff --git a/.github/workflows/runner.yml b/.github/workflows/runner.yml index fd5e74b914a..01a313fdcd7 100644 --- a/.github/workflows/runner.yml +++ b/.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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0b02b440dfd..9127ad86e08 100644 --- a/.pre-commit-config.yaml +++ b/.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 diff --git a/misc/utility/.clang-format-glsl b/misc/utility/clang_format_glsl.yml similarity index 100% rename from misc/utility/.clang-format-glsl rename to misc/utility/clang_format_glsl.yml