Created by: FFY00
Okay, this has been a long time coming. The current code style is a mess, not even the indentation is consistent.
This PR introduces the following tools:
- yapf (code formater)
- isort (import sorter)
- flake8 (various code quality checks)
- pre-commit (misc checks, runs the tools listed above)
It also introduces a pre-commit config. pre-commit is used to run all the tests, it can be run standalone (pre-commit run
or pre-commit run --all-files
, I have this aliased to pca
in my system) and it can also install a git hook to run everything when commiting. By default, it only runs the tools against the change files, this can be changed by passing the --all-files
flag. To install the git hook, simply run pre-commit install
. More info can be found here: https://pre-commit.com.
I also added a github action workflow to run all the checks.
I opted for yapf instead of black as I think black is very strict and has made some questionable choices when it comes to the code style they enforce.
@pfps what do you think?