Add pre-commit hook to run black, flake8 & isort

This commit is contained in:
Santiago L 2022-02-10 14:05:26 +01:00
parent 0af1de4a1b
commit e31104d038
3 changed files with 29 additions and 0 deletions

13
.pre-commit-config.yaml Normal file
View file

@ -0,0 +1,13 @@
repos:
- repo: https://github.com/psf/black
rev: 22.1.0
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
rev: 5.9.3
hooks:
- id: isort
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8

6
pyproject.toml Normal file
View file

@ -0,0 +1,6 @@
[tool.black]
skip-string-normalization = true
target-version = ['py38']
[tool.isort]
multi_line_output = 4

10
tox.ini Normal file
View file

@ -0,0 +1,10 @@
[flake8]
count = True
exclude =
migrations
resources # exclude code that will be deprecated
tests # exclude code that will be deprecated
max-complexity = 10
max-line-length = 120
show-source = True
statistics = True