diff options
author | Aarni Koskela <akx@iki.fi> | 2024-01-09 14:47:16 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-02-26 14:57:53 +0100 |
commit | 20c563de40923d3333301ca8ed1f3f213a67ea17 (patch) | |
tree | 9da6a86399de77c74aba91e3d48b408b0a8516c2 /misc/hooks/README.md | |
parent | bb6b06c81343073f10cbbd2af515cf0dac1e6549 (diff) | |
download | redot-engine-20c563de40923d3333301ca8ed1f3f213a67ea17.tar.gz |
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>
Diffstat (limited to 'misc/hooks/README.md')
-rw-r--r-- | misc/hooks/README.md | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/misc/hooks/README.md b/misc/hooks/README.md deleted file mode 100644 index 573f8fe350..0000000000 --- a/misc/hooks/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# Git hooks for Godot Engine - -This folder contains Git hooks meant to be installed locally by Godot Engine -contributors to make sure they comply with our requirements. - -## List of hooks - -- Pre-commit hook for `clang-format`: Applies `clang-format` to the staged - files before accepting a commit; blocks the commit and generates a patch if - the style is not respected. - You may need to edit the file if your `clang-format` binary is not in the - `PATH`, or if you want to enable colored output with `pygmentize`. -- Pre-commit hook for `black`: Applies `black` to the staged Python files - before accepting a commit. -- Pre-commit hook for `make_rst`: Checks the class reference syntax using - `make_rst.py`. - -## Installation - -Copy all the files from this folder into your `.git/hooks` folder, and make -sure the hooks and helper scripts are executable. - -#### Linux/macOS - -The hooks rely on bash scripts and tools which should be in the system `PATH`, -so they should work out of the box on Linux/macOS. - -#### Windows - -##### clang-format -- Download LLVM for Windows (version 13 or later) from - <https://github.com/llvm/llvm-project/releases> -- Make sure LLVM is added to the `PATH` during installation - -##### 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. |