diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-08-30 16:18:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-30 16:18:31 +0200 |
commit | 08eafbd52b0522e36a8eec2463b45066a469526e (patch) | |
tree | c16041c5dad478f8d81e1ae5912357da0a95709e /misc/hooks | |
parent | f58d864f867902e8650f428dc75d5bbb0b874727 (diff) | |
parent | 8e2d0e1bb16409ad2e32e6e59432ffafb03c14ee (diff) |
Merge pull request #65078 from RandomShaper/git_hooks_extend
Diffstat (limited to 'misc/hooks')
-rw-r--r-- | misc/hooks/README.md | 5 | ||||
-rwxr-xr-x | misc/hooks/pre-commit | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/misc/hooks/README.md b/misc/hooks/README.md index 8732237244..ea94b3f5f3 100644 --- a/misc/hooks/README.md +++ b/misc/hooks/README.md @@ -35,3 +35,8 @@ so they should work out of the box on Linux/macOS. ##### black - Python installation: make sure Python is added to the `PATH` - Install `black` - in any console: `pip3 install black` + +## Custom hooks + +The pre-commit hook will run any other script in `.git/hooks` whose filename +matches `pre-commit-custom-*`, after the Godot ones. diff --git a/misc/hooks/pre-commit b/misc/hooks/pre-commit index ab0fc8176f..6359161260 100755 --- a/misc/hooks/pre-commit +++ b/misc/hooks/pre-commit @@ -13,8 +13,8 @@ # pre-commit hooks to be executed. They should be in the same .git/hooks/ folder # as this script. Hooks should return 0 if successful and nonzero to cancel the # commit. They are executed in the order in which they are listed. -#HOOKS="pre-commit-compile pre-commit-uncrustify" HOOKS="pre-commit-clang-format pre-commit-black pre-commit-make-rst" +HOOKS="$HOOKS $(find $(dirname -- "$0") -type f -name 'pre-commit-custom-*' -exec basename {} \;)" ########################################################### # There should be no need to change anything below this line. |