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