| 1 |
default_language_version: |
| 2 |
python: python3 |
| 3 |
|
| 4 |
exclude: | |
| 5 |
(?x)^( |
| 6 |
.*thirdparty/.*| |
| 7 |
.*-(dll|dylib|so)_wrap\.[ch]| |
| 8 |
platform/android/java/editor/src/main/java/com/android/.*| |
| 9 |
platform/android/java/lib/src/main/java/com/google/.* |
| 10 |
)$ |
| 11 |
|
| 12 |
repos: |
| 13 |
- repo: https://github.com/pre-commit/pre-commit-hooks |
| 14 |
rev: v6.0.0 |
| 15 |
hooks: |
| 16 |
- id: check-executables-have-shebangs |
| 17 |
- id: check-shebang-scripts-are-executable |
| 18 |
exclude: (SConstruct|SCsub)$ |
| 19 |
|
| 20 |
- repo: https://github.com/pre-commit/mirrors-clang-format |
| 21 |
rev: v21.1.7 |
| 22 |
hooks: |
| 23 |
- id: clang-format |
| 24 |
files: \.(c|h|cpp|hpp|cc|hh|cxx|hxx|m|mm|inc|java)$ |
| 25 |
types_or: [text] |
| 26 |
- id: clang-format |
| 27 |
name: clang-format-glsl |
| 28 |
files: \.glsl$ |
| 29 |
types_or: [text] |
| 30 |
args: [-style=file:misc/utility/clang_format_glsl.yml] |
| 31 |
|
| 32 |
- repo: https://github.com/pocc/pre-commit-hooks |
| 33 |
rev: v1.3.5 |
| 34 |
hooks: |
| 35 |
- id: clang-tidy |
| 36 |
files: \.(c|h|cpp|hpp|cc|hh|cxx|hxx|m|mm|inc|java|glsl)$ |
| 37 |
args: [--fix, --quiet, --use-color] |
| 38 |
types_or: [text] |
| 39 |
additional_dependencies: [clang-tidy==21.1.6] |
| 40 |
require_serial: true |
| 41 |
stages: [manual] |
| 42 |
|
| 43 |
- repo: https://github.com/astral-sh/ruff-pre-commit |
| 44 |
rev: v0.14.7 |
| 45 |
hooks: |
| 46 |
- id: ruff-check |
| 47 |
args: [--fix] |
| 48 |
files: (\.py|SConstruct|SCsub)$ |
| 49 |
types_or: [text] |
| 50 |
- id: ruff-format |
| 51 |
files: (\.py|SConstruct|SCsub)$ |
| 52 |
types_or: [text] |
| 53 |
|
| 54 |
- repo: https://github.com/pre-commit/mirrors-mypy |
| 55 |
rev: v1.14.1 |
| 56 |
hooks: |
| 57 |
- id: mypy |
| 58 |
files: \.py$ |
| 59 |
types_or: [text] |
| 60 |
|
| 61 |
- repo: https://github.com/codespell-project/codespell |
| 62 |
rev: v2.4.1 |
| 63 |
hooks: |
| 64 |
- id: codespell |
| 65 |
additional_dependencies: [tomli] |
| 66 |
|
| 67 |
- repo: https://github.com/python-jsonschema/check-jsonschema |
| 68 |
rev: 0.34.1 |
| 69 |
hooks: |
| 70 |
- id: check-jsonschema |
| 71 |
files: ^core/extension/gdextension_interface\.json$ |
| 72 |
args: ["--schemafile", "core/extension/gdextension_interface.schema.json"] |
| 73 |
|
| 74 |
- repo: local |
| 75 |
hooks: |
| 76 |
- id: make-rst |
| 77 |
name: make-rst |
| 78 |
language: python |
| 79 |
entry: python doc/tools/make_rst.py |
| 80 |
args: [doc/classes, modules, platform, --dry-run, --color] |
| 81 |
pass_filenames: false |
| 82 |
files: ^(doc/classes|.*/doc_classes)/.*\.xml$ |
| 83 |
|
| 84 |
- id: doc-status |
| 85 |
name: doc-status |
| 86 |
language: python |
| 87 |
entry: python doc/tools/doc_status.py |
| 88 |
args: [doc/classes, modules/*/doc_classes, platform/*/doc_classes, -c] |
| 89 |
pass_filenames: false |
| 90 |
files: ^(doc/classes|.*/doc_classes)/.*\.xml$ |
| 91 |
|
| 92 |
- id: validate-builders |
| 93 |
name: validate-builders |
| 94 |
language: python |
| 95 |
entry: python tests/python_build/validate_builders.py |
| 96 |
pass_filenames: false |
| 97 |
files: ^(gles3|glsl)_builders\.py$ |
| 98 |
|
| 99 |
- id: validate-xml |
| 100 |
name: validate-xml |
| 101 |
language: python |
| 102 |
entry: python misc/scripts/validate_xml.py |
| 103 |
files: ^(doc/classes|.*/doc_classes)/.*\.xml$ |
| 104 |
additional_dependencies: [xmlschema] |
| 105 |
|
| 106 |
- id: eslint |
| 107 |
name: eslint |
| 108 |
language: node |
| 109 |
entry: eslint |
| 110 |
files: ^(platform/web/js/|modules/|misc/dist/html/).*\.(js|html)$ |
| 111 |
args: |
| 112 |
- --fix |
| 113 |
- --no-warn-ignored |
| 114 |
- --no-config-lookup |
| 115 |
- --config |
| 116 |
- platform/web/eslint.config.cjs |
| 117 |
additional_dependencies: |
| 118 |
- "@eslint/js@^9.3.0" |
| 119 |
- "@html-eslint/eslint-plugin@^0.24.1" |
| 120 |
- "@html-eslint/parser@^0.24.1" |
| 121 |
- "@stylistic/eslint-plugin@^2.1.0" |
| 122 |
- eslint@^9.3.0 |
| 123 |
- eslint-plugin-html@^8.1.1 |
| 124 |
- globals@^15.3.0 |
| 125 |
- espree@^10.0.1 |
| 126 |
|
| 127 |
- id: jsdoc |
| 128 |
name: jsdoc |
| 129 |
language: node |
| 130 |
entry: jsdoc |
| 131 |
files: ^platform/web/js/engine/(engine|config|features)\.js$ |
| 132 |
args: |
| 133 |
- --template |
| 134 |
- platform/web/js/jsdoc2rst/ |
| 135 |
- platform/web/js/engine/engine.js |
| 136 |
- platform/web/js/engine/config.js |
| 137 |
- platform/web/js/engine/features.js |
| 138 |
- --destination |
| 139 |
- "" |
| 140 |
- -d |
| 141 |
- dry-run |
| 142 |
pass_filenames: false |
| 143 |
additional_dependencies: [jsdoc@^4.0.3] |
| 144 |
|
| 145 |
- id: svgo |
| 146 |
name: svgo |
| 147 |
language: node |
| 148 |
entry: svgo |
| 149 |
files: \.svg$ |
| 150 |
args: [--quiet, --config, misc/utility/svgo.config.mjs] |
| 151 |
additional_dependencies: [[email protected]] |
| 152 |
|
| 153 |
- id: copyright-headers |
| 154 |
name: copyright-headers |
| 155 |
language: python |
| 156 |
entry: python misc/scripts/copyright_headers.py |
| 157 |
files: \.(c|h|cpp|hpp|cc|hh|cxx|hxx|m|mm|inc|java)$ |
| 158 |
exclude: | |
| 159 |
(?x)^( |
| 160 |
core/math/bvh_.*\.inc| |
| 161 |
platform/(?!android|ios|linuxbsd|macos|web|windows)\w+/.*| |
| 162 |
platform/android/java/lib/src/main/java/org/godotengine/godot/gl/GLSurfaceView\.java| |
| 163 |
platform/android/java/lib/src/main/java/org/godotengine/godot/gl/EGLLogWrapper\.java| |
| 164 |
platform/android/java/lib/src/main/java/org/godotengine/godot/utils/ProcessPhoenix\.java |
| 165 |
)$ |
| 166 |
|
| 167 |
- id: header-guards |
| 168 |
name: header-guards |
| 169 |
language: python |
| 170 |
entry: python misc/scripts/header_guards.py |
| 171 |
files: \.(h|hpp|hh|hxx)$ |
| 172 |
|
| 173 |
- id: file-format |
| 174 |
name: file-format |
| 175 |
language: python |
| 176 |
entry: python misc/scripts/file_format.py |
| 177 |
types_or: [text] |
| 178 |
exclude: | |
| 179 |
(?x)^( |
| 180 |
.*\.test\.txt| |
| 181 |
.*\.svg| |
| 182 |
.*\.patch| |
| 183 |
.*\.out| |
| 184 |
modules/gdscript/tests/scripts/parser/features/mixed_indentation_on_blank_lines\.gd| |
| 185 |
modules/gdscript/tests/scripts/parser/warnings/empty_file_newline_comment\.norun\.gd| |
| 186 |
modules/gdscript/tests/scripts/parser/warnings/empty_file_newline\.norun\.gd| |
| 187 |
tests/data/.*\.bin |
| 188 |
)$ |
| 189 |
|
| 190 |
- id: dotnet-format |
| 191 |
name: dotnet-format |
| 192 |
language: python |
| 193 |
entry: python misc/scripts/dotnet_format.py |
| 194 |
types_or: [c#] |
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
|
| 199 |
|
| 200 |
|
| 201 |
|
| 202 |
|
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
|