2024-06-02 18:22:34 +00:00
|
|
|
default_language_version:
|
|
|
|
python: python3
|
|
|
|
|
2024-05-01 21:02:35 +00:00
|
|
|
exclude: |
|
|
|
|
(?x)^(
|
|
|
|
.*thirdparty/.*|
|
|
|
|
.*-so_wrap\.(h|c)$
|
|
|
|
)
|
|
|
|
|
2024-01-09 12:47:16 +00:00
|
|
|
repos:
|
|
|
|
- repo: https://github.com/pre-commit/mirrors-clang-format
|
2024-02-28 13:25:35 +00:00
|
|
|
rev: v17.0.6
|
2024-01-09 12:47:16 +00:00
|
|
|
hooks:
|
|
|
|
- id: clang-format
|
2024-06-02 18:22:34 +00:00
|
|
|
files: \.(c|h|cpp|hpp|cc|hh|cxx|hxx|m|mm|inc|java|glsl)$
|
2024-01-09 12:47:16 +00:00
|
|
|
types_or: [text]
|
|
|
|
exclude: |
|
|
|
|
(?x)^(
|
2024-05-01 21:02:35 +00:00
|
|
|
tests/python_build/.*|
|
2024-08-26 18:12:50 +00:00
|
|
|
platform/android/java/editor/src/main/java/com/android/.*|
|
2024-05-01 21:02:35 +00:00
|
|
|
platform/android/java/lib/src/com/.*
|
2024-01-09 12:47:16 +00:00
|
|
|
)
|
|
|
|
|
2024-06-17 15:39:02 +00:00
|
|
|
- repo: https://github.com/pocc/pre-commit-hooks
|
|
|
|
rev: v1.3.5
|
|
|
|
hooks:
|
|
|
|
- id: clang-tidy
|
|
|
|
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/.*|
|
2024-08-26 18:12:50 +00:00
|
|
|
platform/android/java/editor/src/main/java/com/android/.*|
|
2024-06-17 15:39:02 +00:00
|
|
|
platform/android/java/lib/src/com/.*
|
|
|
|
)
|
|
|
|
additional_dependencies: [clang-tidy==18.1.1]
|
|
|
|
require_serial: true
|
|
|
|
stages: [manual] # Not automatically triggered, invoked via `pre-commit run --hook-stage manual clang-tidy`
|
|
|
|
|
2024-05-21 13:14:59 +00:00
|
|
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
|
|
rev: v0.4.4
|
2024-01-09 12:47:16 +00:00
|
|
|
hooks:
|
2024-05-21 13:14:59 +00:00
|
|
|
- id: ruff
|
|
|
|
args: [--fix]
|
|
|
|
- id: ruff-format
|
2024-01-09 12:47:16 +00:00
|
|
|
|
2024-05-01 21:02:35 +00:00
|
|
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
|
|
rev: v0.971
|
|
|
|
hooks:
|
|
|
|
- id: mypy
|
|
|
|
files: \.py$
|
|
|
|
types_or: [text]
|
|
|
|
|
|
|
|
- repo: https://github.com/codespell-project/codespell
|
2024-06-03 15:19:58 +00:00
|
|
|
rev: v2.3.0
|
2024-05-01 21:02:35 +00:00
|
|
|
hooks:
|
|
|
|
- id: codespell
|
2024-08-26 18:12:50 +00:00
|
|
|
exclude: |
|
|
|
|
(?x)^(
|
|
|
|
platform/android/java/editor/src/main/java/com/android/.*|
|
|
|
|
platform/android/java/lib/src/com/.*
|
|
|
|
)
|
2024-06-03 15:19:58 +00:00
|
|
|
additional_dependencies: [tomli]
|
2024-05-01 21:02:35 +00:00
|
|
|
|
|
|
|
### Requires Docker; look into alternative implementation.
|
|
|
|
# - repo: https://github.com/comkieffer/pre-commit-xmllint.git
|
|
|
|
# rev: 1.0.0
|
|
|
|
# hooks:
|
|
|
|
# - id: xmllint
|
|
|
|
# language: docker
|
|
|
|
# types_or: [text]
|
|
|
|
# files: ^(doc/classes|.*/doc_classes)/.*\.xml$
|
|
|
|
# args: [--schema, doc/class.xsd]
|
|
|
|
|
2024-01-09 12:47:16 +00:00
|
|
|
- repo: local
|
|
|
|
hooks:
|
|
|
|
- id: make-rst
|
|
|
|
name: make-rst
|
2024-05-01 21:02:35 +00:00
|
|
|
language: python
|
2024-06-02 18:22:34 +00:00
|
|
|
entry: python doc/tools/make_rst.py
|
|
|
|
args: [doc/classes, modules, platform, --dry-run, --color]
|
2024-01-09 12:47:16 +00:00
|
|
|
pass_filenames: false
|
2024-05-01 21:02:35 +00:00
|
|
|
files: ^(doc/classes|.*/doc_classes)/.*\.xml$
|
|
|
|
|
|
|
|
- id: doc-status
|
|
|
|
name: doc-status
|
2024-01-09 12:47:16 +00:00
|
|
|
language: python
|
2024-06-02 18:22:34 +00:00
|
|
|
entry: python doc/tools/doc_status.py
|
|
|
|
args: [doc/classes, modules/*/doc_classes, platform/*/doc_classes]
|
|
|
|
pass_filenames: false
|
2024-05-01 21:02:35 +00:00
|
|
|
files: ^(doc/classes|.*/doc_classes)/.*\.xml$
|
|
|
|
|
2024-05-12 02:16:02 +00:00
|
|
|
- id: eslint
|
|
|
|
name: eslint
|
|
|
|
language: node
|
|
|
|
entry: eslint
|
|
|
|
files: ^(platform/web/js/|modules/|misc/dist/html/).*\.(js|html)$
|
2024-07-08 15:41:20 +00:00
|
|
|
args:
|
2024-09-16 15:03:08 +00:00
|
|
|
- --fix
|
|
|
|
- --no-warn-ignored
|
|
|
|
- --no-config-lookup
|
|
|
|
- --config
|
|
|
|
- platform/web/eslint.config.cjs
|
2024-05-12 02:16:02 +00:00
|
|
|
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'
|
2024-07-08 15:41:20 +00:00
|
|
|
- eslint@^9.3.0
|
|
|
|
- eslint-plugin-html@^8.1.1
|
|
|
|
- globals@^15.3.0
|
|
|
|
- espree@^10.0.1
|
2024-05-12 02:16:02 +00:00
|
|
|
|
2024-05-01 21:02:35 +00:00
|
|
|
- id: jsdoc
|
|
|
|
name: jsdoc
|
|
|
|
language: node
|
|
|
|
entry: jsdoc
|
|
|
|
files: ^platform/web/js/engine/(engine|config|features)\.js$
|
2024-05-16 11:50:13 +00:00
|
|
|
args:
|
|
|
|
- --template
|
|
|
|
- platform/web/js/jsdoc2rst/
|
|
|
|
- platform/web/js/engine/engine.js
|
|
|
|
- platform/web/js/engine/config.js
|
|
|
|
- platform/web/js/engine/features.js
|
|
|
|
- --destination
|
|
|
|
- ''
|
|
|
|
- -d
|
|
|
|
- dry-run
|
|
|
|
pass_filenames: false
|
2024-07-08 15:41:20 +00:00
|
|
|
additional_dependencies: [jsdoc@^4.0.3]
|
2024-01-09 12:47:16 +00:00
|
|
|
|
2024-06-04 14:49:56 +00:00
|
|
|
- id: svgo
|
|
|
|
name: svgo
|
|
|
|
language: node
|
|
|
|
entry: svgo
|
|
|
|
files: \.svg$
|
|
|
|
args: [--quiet, --config, misc/utility/svgo.config.mjs]
|
2024-07-08 15:41:20 +00:00
|
|
|
additional_dependencies: [svgo@3.3.2]
|
2024-06-04 14:49:56 +00:00
|
|
|
|
2024-01-09 12:47:16 +00:00
|
|
|
- id: copyright-headers
|
|
|
|
name: copyright-headers
|
|
|
|
language: python
|
2024-06-02 18:22:34 +00:00
|
|
|
entry: python misc/scripts/copyright_headers.py
|
|
|
|
files: \.(c|h|cpp|hpp|cc|hh|cxx|hxx|m|mm|inc|java)$
|
2024-01-09 12:47:16 +00:00
|
|
|
exclude: |
|
|
|
|
(?x)^(
|
2024-03-12 14:07:09 +00:00
|
|
|
core/math/bvh_.*\.inc$|
|
2024-05-21 13:58:47 +00:00
|
|
|
platform/(?!android|ios|linuxbsd|macos|web|windows)\w+/.*|
|
2024-08-26 18:12:50 +00:00
|
|
|
platform/android/java/editor/src/main/java/com/android/.*|
|
2024-05-01 21:02:35 +00:00
|
|
|
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$
|
|
|
|
)
|
|
|
|
|
|
|
|
- id: header-guards
|
|
|
|
name: header-guards
|
|
|
|
language: python
|
2024-06-02 18:22:34 +00:00
|
|
|
entry: python misc/scripts/header_guards.py
|
|
|
|
files: \.(h|hpp|hh|hxx)$
|
|
|
|
exclude: ^.*/(thread|platform_config|platform_gl)\.h$
|
2024-05-01 21:02:35 +00:00
|
|
|
|
|
|
|
- id: file-format
|
|
|
|
name: file-format
|
|
|
|
language: python
|
2024-06-02 18:22:34 +00:00
|
|
|
entry: python misc/scripts/file_format.py
|
2024-05-01 21:02:35 +00:00
|
|
|
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\.notest\.gd$|
|
|
|
|
modules/gdscript/tests/scripts/parser/warnings/empty_file_newline\.notest\.gd$|
|
2024-06-16 19:14:34 +00:00
|
|
|
platform/android/java/editor/src/main/java/com/android/.*|
|
2024-05-01 21:02:35 +00:00
|
|
|
platform/android/java/lib/src/com/google/.*
|
2024-01-09 12:47:16 +00:00
|
|
|
)
|
2024-02-27 20:09:04 +00:00
|
|
|
|
|
|
|
- id: dotnet-format
|
|
|
|
name: dotnet-format
|
|
|
|
language: python
|
2024-06-02 18:22:34 +00:00
|
|
|
entry: python misc/scripts/dotnet_format.py
|
2024-02-27 20:09:04 +00:00
|
|
|
types_or: [c#]
|
2024-07-08 15:41:20 +00:00
|
|
|
#
|
2024-05-21 13:58:47 +00:00
|
|
|
# End of upstream Godot pre-commit hooks.
|
|
|
|
#
|
|
|
|
# Keep this separation to let downstream forks add their own hooks to this file,
|
|
|
|
# without running into merge conflicts when rebasing on latest upstream.
|
|
|
|
#
|
|
|
|
# Start of downstream pre-commit hooks.
|
|
|
|
#
|
|
|
|
# This is still the "repo: local" scope, so new local hooks can be defined directly at this indentation:
|
|
|
|
# - id: new-local-hook
|
|
|
|
# To add external repo hooks, bring the indentation back to:
|
|
|
|
# - repo: my-remote-hook
|