Skip to content

Commit d7fc615

Browse files
committed
CONTRIBUTING: Improve pre-commit documentation
1 parent 586d8e0 commit d7fc615

1 file changed

Lines changed: 32 additions & 5 deletions

File tree

docs/CONTRIBUTING.md

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,45 @@ GDScript source code should follow the [GDScript style guide][]. This is
3939
enforced using `gdlint` and `gdformat` from [godot-gdscript-toolkit][] when
4040
changes are submitted to the project.
4141

42-
You can use [pre-commit][] to run the same checks locally. Install `pre-commit`
43-
then run the following command in your Threadbare checkout:
42+
You can use [pre-commit][] to run the same checks locally. `pre-commit`.
43+
`pre-commit` is written in Python, so if you don't have Python installed, you'll
44+
also need to install Python. The Threadbare team recommends using [`uv`][uv] to
45+
install and manage `pre-commit`, as well as installing Python if needed.
4446

45-
```
46-
pre-commit install
47-
```
47+
### Install `pre-commit` with `uv`
48+
49+
1. Install `uv` using
50+
[these instructions](https://docs.astral.sh/uv/#installation)
51+
52+
2. Install `pre-commit`:
53+
54+
```
55+
uv tool install pre-commit
56+
```
57+
58+
3. If you need to upgrade `pre-commit` in future, use this command:
59+
60+
```
61+
uv tool upgrade pre-commit
62+
```
63+
64+
> [!NOTE]
65+
> If you prefer to install `pre-commit` another way, that's fine!
66+
67+
### Set up `pre-commit` for Threadbare
68+
69+
Run the following command in your Threadbare checkout to set up `pre-commit`:
70+
71+
```
72+
pre-commit install
73+
```
4874

4975
Now, coding style checks will be enforced when you run `git commit`.
5076

5177
[GDScript style guide]: https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/gdscript_styleguide.html
5278
[godot-gdscript-toolkit]: https://github.com/Scony/godot-gdscript-toolkit
5379
[pre-commit]: https://pre-commit.com/
80+
[uv]: https://docs.astral.sh/uv/
5481

5582
## Git commit messages and pull request descriptions
5683

0 commit comments

Comments
 (0)