docs: add instruction on how to use pre-commit

environments/review-docs-pre-c-zs4ui8/deployments/15563
jo 2022-11-18 22:49:04 +01:00 zatwierdzone przez Marge Me
rodzic 45630be695
commit 753e9dcfd4
2 zmienionych plików z 21 dodań i 0 usunięć

Wyświetl plik

@ -9,6 +9,7 @@ maxdepth: 1
---
git
pre-commit
changelog
release

Wyświetl plik

@ -0,0 +1,20 @@
# Pre-commit
Funkwhale uses [pre-commit](https://pre-commit.com/) to ensure that the files you commit are properly formatted, follow best practice, and don't contain syntax or spelling errors.
You can install and setup pre-commit using the [quick-start guide on the pre-commit documentation](https://pre-commit.com/#quick-start). Make sure to install pre-commit and setup the git pre-commit hook so pre-commit runs before you commit any changes to the repository.
The workflow looks like this:
1. Install `pre-commit`.
2. After cloning the repository, setup the pre-commit git hooks:
```sh
git clone git@dev.funkwhale.audio:funkwhale/funkwhale.git
cd funkwhale
pre-commit install
```
3. Make your changes and commit them.
4. If `pre-commit` fails to validate your changes, the commit process stops. Fix any reported errors and try again.