Skip to content

Commit b1354a4

Browse files
committed
README: Added paragraph about pre-commit hooks
1 parent 0b409b0 commit b1354a4

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,51 @@ We do enforce some linting, testing and static type checking. This can and **sho
146146
> [!TIP]
147147
> In order to implement a new fix, it is best practice to use [local fixes](#local-fixes).
148148
149+
### Pre commit hooks
150+
151+
We have some [pre-commit hooks](https://pre-commit.com/) in place.
152+
153+
> [!TIP]
154+
> This is the easiest way to check for any mistakes that need fixing before we can accept a pull request.
155+
156+
Install it:
157+
158+
```bash
159+
pip install pre-commit
160+
```
161+
162+
or on Arch / Manjaro:
163+
164+
```bash
165+
sudo pacman -Sy pre-commit
166+
```
167+
168+
To set up the hook in your work directory, run the following command:
169+
170+
```bash
171+
pre-commit install
172+
```
173+
174+
That's it.
175+
The hook should include everything you need and install all the necessary packages in a [virtual environment](https://docs.python.org/3/library/venv.html).
176+
177+
You can also run them manually, without installing the hook:
178+
179+
```bash
180+
pre-commit run
181+
# or on all files, not only staged ones:
182+
pre-commit run --all-files
183+
```
184+
185+
----------
186+
187+
> [!NOTE]
188+
> All of the following information is for documentation purposes only.
189+
>
190+
> The preferred way to check your contribution is to use [pre-commit hooks](#pre-commit-hooks).
191+
192+
----------
193+
149194
### Fix the package name
150195

151196
If you clone the repository, it will default to a directory named `umu-protonfixes`.

0 commit comments

Comments
 (0)