add pre-commit who use black formatting
This commit is contained in:
parent
44352f823b
commit
6afb707bd4
2 changed files with 10 additions and 0 deletions
7
GUIDE.md
7
GUIDE.md
|
@ -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
3
githooks/pre-commit
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
python3 -m black --check .
|
Reference in a new issue