add pre-commit config for flake8

This commit is contained in:
Jon S. Stumpf 2019-05-31 13:38:39 -04:00 committed by David Lord
parent b61cbf8ab4
commit 549fed29ea
No known key found for this signature in database
GPG Key ID: 7A1C87E3F5BC42A8
6 changed files with 41 additions and 6 deletions

View File

@ -3,3 +3,14 @@ repos:
rev: 19.3b0 rev: 19.3b0
hooks: hooks:
- id: black - id: black
- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.7
hooks:
- id: flake8
additional_dependencies: [flake8-bugbear]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.1.0
hooks:
- id: check-byte-order-marker
- id: trailing-whitespace
- id: end-of-file-fixer

View File

@ -22,3 +22,27 @@ source =
flask flask
.tox/*/lib/python*/site-packages/flask .tox/*/lib/python*/site-packages/flask
.tox/pypy/site-packages/flask .tox/pypy/site-packages/flask
[flake8]
# B = bugbear
# E = pycodestyle errors
# F = flake8 pyflakes
# W = pycodestyle warnings
# B9 = bugbear opinions
select = B, E, F, W, B9
ignore =
# slice notation whitespace, invalid
E203
# import at top, too many circular import fixes
E402
# line length, handled by bugbear B950
E501
# bare except, handled by bugbear B001
E722
# bin op line break, invalid
W503
# up to 88 allowed by bugbear B950
max-line-length = 80
per-file-ignores =
# __init__ modules export names
**/__init__.py: F401