add pre-commit who use black formatting

This commit is contained in:
Mylloon 2023-05-07 04:09:08 +02:00
parent 44352f823b
commit 6afb707bd4
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
2 changed files with 10 additions and 0 deletions

View file

@ -58,3 +58,10 @@ class Mycheat(Hack):
Please, use `black` before doing a pull request, as it's the formatter the Please, use `black` before doing a pull request, as it's the formatter the
project use. project use.
On Linux, you can copy the git hook stored in [githooks/](./githooks) who check
the code, preventing any commit with bad formatting.
```sh
$ cp githooks/* .git/hooks/
```

3
githooks/pre-commit Executable file
View file

@ -0,0 +1,3 @@
#!/bin/sh
python3 -m black --check .