Add `pre-commit` with `black`, `isort` and `flake8`.
parent
bf72f6c982
commit
aecfbf0291
|
|
@ -0,0 +1,5 @@
|
|||
[flake8]
|
||||
ignore = E203, E266, E501, W503, F403, F401, F841
|
||||
max-line-length = 89
|
||||
max-complexity = 10
|
||||
select = B,C,E,F,W,T4,B9
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
# See https://pre-commit.com for more information
|
||||
# See https://pre-commit.com/hooks.html for more hooks
|
||||
repos:
|
||||
|
||||
- repo: https://github.com/ambv/black
|
||||
rev: 22.10.0
|
||||
hooks:
|
||||
- id: black
|
||||
language_version: python3.8
|
||||
|
||||
- repo: https://github.com/pycqa/isort
|
||||
rev: 5.10.1
|
||||
hooks:
|
||||
- id: isort
|
||||
args: ["--profile", "black"]
|
||||
|
||||
- repo: https://gitlab.com/pycqa/flake8
|
||||
rev: 3.9.2
|
||||
hooks:
|
||||
- id: flake8
|
||||
exclude: "setup.py"
|
||||
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.3.0
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
# - id: end-of-file-fixer
|
||||
# - id: check-yaml
|
||||
# - id: check-added-large-files
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
[tool.black]
|
||||
py38 = true
|
||||
include = '\.pyi?$'
|
||||
exclude = '''
|
||||
/(
|
||||
\.git
|
||||
| \.hg
|
||||
| \.mypy_cache
|
||||
| \.tox
|
||||
| \.venv
|
||||
| _build
|
||||
| buck-out
|
||||
| build
|
||||
| dist
|
||||
|
||||
# The following are specific to Black, you probably don't want those.
|
||||
| blib2to3
|
||||
| tests/data
|
||||
)/
|
||||
'''
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
codecov
|
||||
coverage
|
||||
pre-commit == 2.20.0
|
||||
psycopg2
|
||||
tox
|
||||
|
|
|
|||
Loading…
Reference in New Issue