Set up pre-commit hooks

- add pre-commit and pre-merge hooks:
  + run `poetry run nox -s pre-commit` on staged *.py files
  + run common pre-commit hooks for validations that could not be
    achieved with tools in the develop environment so easily
  + run `poetry run nox -s pre-merge` before merges and pushes
- implement the "pre-commit" and "pre-merge" sessions in nox
  + include a little hack to deal with the positional arguments
    passed by the pre-commit framework
- provide more documentation on the nox sessions
This commit is contained in:
Alexander Hess 2020-08-04 02:55:41 +02:00
commit da233e2e35
Signed by: alexander
GPG key ID: 344EA5AB10D868E0
4 changed files with 171 additions and 15 deletions

View file

@ -30,6 +30,7 @@ python = "^3.8"
[tool.poetry.dev-dependencies]
# Task Runners
nox = "^2020.5.24"
pre-commit = "^2.6.0"
# Code Formatters
autoflake = "^1.3.1"