Add pre-commit-config file

Adds a precommit config file (and .flake8 config) to enable
CI in jazzband organization. Adds basic following checks:
 * Black
 * isort
 * flake8
 * end-of-file-fixer
 * trailing-whitespace
This commit is contained in:
Matt Seymour 2022-05-04 09:39:20 +01:00 committed by Matt Seymour
parent 6bd09e0661
commit 80770bb243
2 changed files with 24 additions and 1 deletions

View file

@ -2,4 +2,4 @@
max-line-length = 88
extend-ignore = E203
per-file-ignores=
test_dj_database_url.py: E501, E265
test_dj_database_url.py: E501, E265

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

@ -0,0 +1,23 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/pycqa/isort
rev: "5.10.1"
hooks:
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
args: [--target-version=py38]
- repo: https://github.com/pycqa/flake8
rev: '4.0.1'
hooks:
- id: flake8