Skip to content

Commit 7453373

Browse files
authored
Merge pull request #1289 from endlessm/wjt/pre-commit-recognise-piskel-files-via-exclude-types
pre-commit: Recognise piskel files via exclude_types
2 parents d559ebd + d7fc615 commit 7453373

2 files changed

Lines changed: 34 additions & 9 deletions

File tree

.pre-commit-config.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,15 @@ repos:
1616
- id: end-of-file-fixer
1717
exclude: |
1818
(?x)(
19-
\.piskel$|
2019
^scenes/quests/story_quests/(?!stella/|NO_EDIT/)
2120
)
22-
exclude_types: [image]
21+
exclude_types: [svg, piskel]
2322
- id: trailing-whitespace
2423
exclude: |
2524
(?x)(
26-
\.piskel$|
2725
^scenes/quests/story_quests/(?!stella/|NO_EDIT/)
2826
)
29-
exclude_types: [image]
27+
exclude_types: [svg, piskel]
3028

3129
- repo: https://github.com/editorconfig-checker/editorconfig-checker
3230
rev: v3.4.0

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)