From e31104d0384b7c3232035243eda3ab2f9b1cc8cd Mon Sep 17 00:00:00 2001 From: Santiago Lamora Date: Thu, 10 Feb 2022 14:05:26 +0100 Subject: [PATCH] Add pre-commit hook to run black, flake8 & isort --- .pre-commit-config.yaml | 13 +++++++++++++ pyproject.toml | 6 ++++++ tox.ini | 10 ++++++++++ 3 files changed, 29 insertions(+) create mode 100644 .pre-commit-config.yaml create mode 100644 pyproject.toml create mode 100644 tox.ini diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..13fbf401 --- /dev/null +++ b/.pre-commit-config.yaml @@ -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 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..442cc5af --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,6 @@ +[tool.black] +skip-string-normalization = true +target-version = ['py38'] + +[tool.isort] +multi_line_output = 4 diff --git a/tox.ini b/tox.ini new file mode 100644 index 00000000..d9fa1946 --- /dev/null +++ b/tox.ini @@ -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