diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..f7a03542b --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,6 @@ +repos: +- repo: https://github.com/pycqa/flake8 + rev: 6.0.0 + hooks: + - id: flake8 + files: '(src|scripts|conftest.py)' diff --git a/docs/development.rst b/docs/development.rst index d54c6c4e9..f589f25b1 100644 --- a/docs/development.rst +++ b/docs/development.rst @@ -164,6 +164,13 @@ virtual env and run:: pip install -r requirements.d/development.txt +This project utilizes pre-commit to lint code before it is committed. +Although pre-commit is installed when running the command above, the pre-commit hooks +will have to be installed separately. Run this command to install the pre-commit hooks:: + + pre-commit install + + Running the tests ----------------- diff --git a/requirements.d/development.txt b/requirements.d/development.txt index 3c30b2ac2..a8da71dcf 100644 --- a/requirements.d/development.txt +++ b/requirements.d/development.txt @@ -11,3 +11,4 @@ pytest-benchmark Cython twine python-dateutil +pre-commit