forked from godotengine/godot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace hand-written pre-commit hooks with
pre-commit
Python tool
`pre-commit` can be installed with pip, and configured in the Godot repo with `pre-commit install`. It can then easily be run both locally with `pre-commit run`, and on CI, in a cross-platform way. This makes it much easier for contributors to set up pre-commit hooks, without having to manually copy files to their git folder. Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
- Loading branch information
Showing
12 changed files
with
53 additions
and
889 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/mirrors-clang-format | ||
rev: v16.0.6 | ||
hooks: | ||
- id: clang-format | ||
files: \.(c|h|cpp|hpp|cc|cxx|m|mm|inc|java|glsl)$ | ||
types_or: [text] | ||
exclude: | | ||
(?x)^( | ||
tests/python_build.*| | ||
.*thirdparty.*| | ||
.*platform/android/java/lib/src/com.*| | ||
.*-so_wrap.* | ||
) | ||
- repo: https://github.com/psf/black-pre-commit-mirror | ||
rev: 23.3.0 | ||
hooks: | ||
- id: black | ||
files: (\.py$|SConstruct|SCsub) | ||
types_or: [text] | ||
exclude: .*thirdparty.* | ||
args: | ||
- --line-length=120 | ||
|
||
- repo: local | ||
hooks: | ||
- id: make-rst | ||
name: make-rst | ||
entry: python3 doc/tools/make_rst.py doc/classes modules platform --dry-run --color | ||
pass_filenames: false | ||
language: python | ||
files: ^(doc|modules|platform).*xml$ | ||
|
||
- id: copyright-headers | ||
name: copyright-headers | ||
language: python | ||
files: \.(c|h|cpp|hpp|cc|cxx|m|mm|inc|java)$ | ||
entry: python3 misc/scripts/copyright_headers.py | ||
exclude: | | ||
(?x)^( | ||
tests/python_build.*| | ||
.*thirdparty.*| | ||
.*platform/android/java/lib/src/com.*| | ||
.*-so_wrap.*| | ||
platform/android/java/lib/src/org/godotengine/godot/gl/GLSurfaceView.*| | ||
platform/android/java/lib/src/org/godotengine/godot/gl/EGLLogWrapper.*| | ||
platform/android/java/lib/src/org/godotengine/godot/utils/ProcessPhoenix.* | ||
) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.