Closed martinburchell closed 1 year ago
Commits are getting too slow with Black and PEP8 checks on every python file for every commit. We only want to check the files that are being committed .
pre-commit will do this for us. For now I've just added a few checks, namely:
We might want to add more from the complete list of supported hooks
Usage:
Remove our pre-commit hook:
$ rm ~/workspace/camcops/.git/hooks/pre-commit
Inside the virtualenv:
$ cd ~/workspace/camcops/server $ pip install -e . $ pre-commit install
This will now run pre-commit on any committed files.
To run on all files:
$ pre-commit run --all-files
This change also ignores some PEP8 issues that were previously undetected.
Commits are getting too slow with Black and PEP8 checks on every python file for every commit. We only want to check the files that are being committed .
pre-commit will do this for us. For now I've just added a few checks, namely:
We might want to add more from the complete list of supported hooks
Usage:
Remove our pre-commit hook:
Inside the virtualenv:
This will now run pre-commit on any committed files.
To run on all files:
This change also ignores some PEP8 issues that were previously undetected.