2024-06-03 02:22:34 +08:00
|
|
|
default_language_version:
|
|
|
|
python: python3
|
|
|
|
|
2024-05-02 05:02:35 +08:00
|
|
|
exclude: |
|
|
|
|
(?x)^(
|
|
|
|
.*thirdparty/.*|
|
|
|
|
.*-so_wrap\.(h|c)$
|
|
|
|
)
|
|
|
|
|
2024-01-09 20:47:16 +08:00
|
|
|
repos:
|
|
|
|
- repo: https://github.com/pre-commit/mirrors-clang-format
|
2024-11-05 13:52:58 +08:00
|
|
|
rev: v19.1.3
|
2024-01-09 20:47:16 +08:00
|
|
|
hooks:
|
|
|
|
- id: clang-format
|
2024-10-26 02:41:58 +08:00
|
|
|
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/.*
|
|
|
|
)
|
|
|
|
- id: clang-format
|
|
|
|
name: clang-format-glsl
|
2024-11-05 13:52:58 +08:00
|
|
|
files: \.glsl$
|
2024-01-09 20:47:16 +08:00
|
|
|
types_or: [text]
|
|
|
|
exclude: |
|
|
|
|
(?x)^(
|
2024-05-02 05:02:35 +08:00
|
|
|
tests/python_build/.*|
|
2024-08-27 02:12:50 +08:00
|
|
|
platform/android/java/editor/src/main/java/com/android/.*|
|
2024-05-02 05:02:35 +08:00
|
|
|
platform/android/java/lib/src/com/.*
|
2024-01-09 20:47:16 +08:00
|
|
|
)
|
2024-11-05 13:52:58 +08:00
|
|
|
args: ['-style=file:misc/utility/.clang-format-glsl']
|
2024-01-09 20:47:16 +08:00
|
|
|
|
2024-06-17 23:39:02 +08: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-27 02:12:50 +08:00
|
|
|
platform/android/java/editor/src/main/java/com/android/.*|
|
2024-06-17 23:39:02 +08:00
|
|
|
platform/android/java/lib/src/com/.*
|
|
|
|
)
|
2024-11-05 13:52:58 +08:00
|
|
|
additional_dependencies: [clang-tidy==19.1.0]
|
2024-06-17 23:39:02 +08:00
|
|
|
require_serial: true
|
|
|
|
stages: [manual] # Not automatically triggered, invoked via `pre-commit run --hook-stage manual clang-tidy`
|
|
|
|
|
2024-05-21 21:14:59 +08:00
|
|
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
2024-11-12 01:27:42 +08:00
|
|
|
rev: v0.7.3
|
2024-01-09 20:47:16 +08:00
|
|
|
hooks:
|
2024-05-21 21:14:59 +08:00
|
|
|
- id: ruff
|
|
|
|
args: [--fix]
|
|
|
|
- id: ruff-format
|
2024-01-09 20:47:16 +08:00
|
|
|
|
2024-05-02 05:02:35 +08:00
|
|
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
2024-11-12 01:27:42 +08:00
|
|
|
rev: v1.13.0
|
2024-05-02 05:02:35 +08:00
|
|
|
hooks:
|
|
|
|
- id: mypy
|
|
|
|
files: \.py$
|
|
|
|
types_or: [text]
|
|
|
|
|
|
|
|
- repo: https://github.com/codespell-project/codespell
|
2024-06-03 23:19:58 +08:00
|
|
|
rev: v2.3.0
|
2024-05-02 05:02:35 +08:00
|
|
|
hooks:
|
|
|
|
- id: codespell
|
2024-08-27 02:12:50 +08:00
|
|
|
exclude: |
|
|
|
|
(?x)^(
|
|
|
|
platform/android/java/editor/src/main/java/com/android/.*|
|
|
|
|
platform/android/java/lib/src/com/.*
|
|
|
|
)
|
2024-06-03 23:19:58 +08:00
|
|
|
additional_dependencies: [tomli]
|
2024-05-02 05:02:35 +08: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 20:47:16 +08:00
|
|
|
- repo: local
|
|
|
|
hooks:
|
|
|
|
- id: make-rst
|
|
|
|
name: make-rst
|
2024-05-02 05:02:35 +08:00
|
|
|
language: python
|
2024-06-03 02:22:34 +08:00
|
|
|
entry: python doc/tools/make_rst.py
|
|
|
|
args: [doc/classes, modules, platform, --dry-run, --color]
|
2024-01-09 20:47:16 +08:00
|
|
|
pass_filenames: false
|
2024-05-02 05:02:35 +08:00
|
|
|
files: ^(doc/classes|.*/doc_classes)/.*\.xml$
|
|
|
|
|
|
|
|
- id: doc-status
|
|
|
|
name: doc-status
|
2024-01-09 20:47:16 +08:00
|
|
|
language: python
|
2024-06-03 02:22:34 +08:00
|
|
|
entry: python doc/tools/doc_status.py
|
|
|
|
args: [doc/classes, modules/*/doc_classes, platform/*/doc_classes]
|
|
|
|
pass_filenames: false
|
2024-05-02 05:02:35 +08:00
|
|
|
files: ^(doc/classes|.*/doc_classes)/.*\.xml$
|
|
|
|
|
2024-05-12 10:16:02 +08:00
|
|
|
- id: eslint
|
|
|
|
name: eslint
|
|
|
|
language: node
|
|
|
|
entry: eslint
|
|
|
|
files: ^(platform/web/js/|modules/|misc/dist/html/).*\.(js|html)$
|
2024-07-08 23:41:20 +08:00
|
|
|
args:
|
2024-09-16 23:03:08 +08:00
|
|
|
- --fix
|
|
|
|
- --no-warn-ignored
|
|
|
|
- --no-config-lookup
|
|
|
|
- --config
|
|
|
|
- platform/web/eslint.config.cjs
|
2024-05-12 10:16:02 +08: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 23:41:20 +08:00
|
|
|
- eslint@^9.3.0
|
|
|
|
- eslint-plugin-html@^8.1.1
|
|
|
|
- globals@^15.3.0
|
|
|
|
- espree@^10.0.1
|
2024-05-12 10:16:02 +08:00
|
|
|
|
2024-05-02 05:02:35 +08:00
|
|
|
- id: jsdoc
|
|
|
|
name: jsdoc
|
|
|
|
language: node
|
|
|
|
entry: jsdoc
|
|
|
|
files: ^platform/web/js/engine/(engine|config|features)\.js$
|
2024-05-16 19:50:13 +08: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 23:41:20 +08:00
|
|
|
additional_dependencies: [jsdoc@^4.0.3]
|
2024-01-09 20:47:16 +08:00
|
|
|
|
2024-06-04 22:49:56 +08:00
|
|
|
- id: svgo
|
|
|
|
name: svgo
|
|
|
|
language: node
|
|
|
|
entry: svgo
|
|
|
|
files: \.svg$
|
|
|
|
args: [--quiet, --config, misc/utility/svgo.config.mjs]
|
2024-07-08 23:41:20 +08:00
|
|
|
additional_dependencies: [svgo@3.3.2]
|
2024-06-04 22:49:56 +08:00
|
|
|
|
2024-01-09 20:47:16 +08:00
|
|
|
- id: copyright-headers
|
|
|
|
name: copyright-headers
|
|
|
|
language: python
|
2024-06-03 02:22:34 +08:00
|
|
|
entry: python misc/scripts/copyright_headers.py
|
|
|
|
files: \.(c|h|cpp|hpp|cc|hh|cxx|hxx|m|mm|inc|java)$
|
2024-01-09 20:47:16 +08:00
|
|
|
exclude: |
|
|
|
|
(?x)^(
|
2024-03-12 22:07:09 +08:00
|
|
|
core/math/bvh_.*\.inc$|
|
2024-05-21 21:58:47 +08:00
|
|
|
platform/(?!android|ios|linuxbsd|macos|web|windows)\w+/.*|
|
2024-08-27 02:12:50 +08:00
|
|
|
platform/android/java/editor/src/main/java/com/android/.*|
|
2024-05-02 05:02:35 +08: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-03 02:22:34 +08:00
|
|
|
entry: python misc/scripts/header_guards.py
|
|
|
|
files: \.(h|hpp|hh|hxx)$
|
|
|
|
exclude: ^.*/(thread|platform_config|platform_gl)\.h$
|
2024-05-02 05:02:35 +08:00
|
|
|
|
|
|
|
- id: file-format
|
|
|
|
name: file-format
|
|
|
|
language: python
|
2024-06-03 02:22:34 +08:00
|
|
|
entry: python misc/scripts/file_format.py
|
2024-05-02 05:02:35 +08: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-17 03:14:34 +08:00
|
|
|
platform/android/java/editor/src/main/java/com/android/.*|
|
2024-10-02 10:41:13 +08:00
|
|
|
platform/android/java/lib/src/com/google/.*|
|
|
|
|
tests/data/.*\.bin$
|
2024-01-09 20:47:16 +08:00
|
|
|
)
|
2024-02-28 04:09:04 +08:00
|
|
|
|
|
|
|
- id: dotnet-format
|
|
|
|
name: dotnet-format
|
|
|
|
language: python
|
2024-06-03 02:22:34 +08:00
|
|
|
entry: python misc/scripts/dotnet_format.py
|
2024-02-28 04:09:04 +08:00
|
|
|
types_or: [c#]
|
2024-07-08 23:41:20 +08:00
|
|
|
#
|
2024-05-21 21:58:47 +08: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
|