summaryrefslogtreecommitdiff
path: root/.pre-commit-config.yaml
diff options
context:
space:
mode:
Diffstat (limited to '.pre-commit-config.yaml')
-rw-r--r--.pre-commit-config.yaml46
1 files changed, 46 insertions, 0 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644
index 0000000..22c0862
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,46 @@
+default_language_version:
+ python: python3.7
+
+repos:
+ - repo: https://github.com/pre-commit/pre-commit-hooks
+ rev: "v2.4.0"
+ hooks:
+ # General file-formatting
+ - id: trailing-whitespace
+ args: [--markdown-linebreak-ext=md]
+ - id: end-of-file-fixer
+ - id: check-json
+ - id: check-toml
+
+ # Python-related
+ - id: debug-statements
+ - id: name-tests-test
+ args: ["--django"] # Required to match on test*.py
+
+ # Git-related
+ - id: no-commit-to-branch
+ - id: check-merge-conflict
+
+ - repo: https://gitlab.com/pycqa/flake8
+ rev: "3.7.9"
+ hooks:
+ - id: flake8
+ additional_dependencies:
+ - flake8-bugbear # Finds common application design anti-patterns
+
+ - repo: https://github.com/pre-commit/pygrep-hooks
+ rev: "v1.4.2"
+ hooks:
+ - id: python-check-blanket-noqa
+
+ - repo: https://github.com/pre-commit/mirrors-isort
+ rev: "v4.3.21"
+ hooks:
+ - id: isort
+ additional_dependencies:
+ - toml # Required for loading config from pyproject.toml
+
+ - repo: https://github.com/ambv/black
+ rev: "19.10b0"
+ hooks:
+ - id: black