Run Black + Flake8 + isort before commit automatically

This commit is contained in:
Ivan Golikov 2022-06-12 15:33:14 +03:00
parent 2dc28192f2
commit c28c307670
3 changed files with 38 additions and 0 deletions

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

@ -0,0 +1,29 @@
repos:
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
language_version: python3.10
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/pycqa/flake8
rev: 4.0.1
hooks:
- id: flake8
entry: pflake8
additional_dependencies:
- flake8-bugbear
- flake8-comprehensions
- flake8-simplify
- pyproject-flake8
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
name: isort

View file

@ -1,3 +1,10 @@
[build-system] [build-system]
requires = ["setuptools>=42"] requires = ["setuptools>=42"]
build-backend = "setuptools.build_meta" build-backend = "setuptools.build_meta"
[tool.isort]
profile = "black"
[tool.flake8]
max-line-length = 88
extend-ignore = "E203, B008"

View file

@ -13,6 +13,8 @@ python_requires = >=3.10
[options.extras_require] [options.extras_require]
hiredis = hiredis =
hiredis==2.0.0 hiredis==2.0.0
development =
pre-commit==2.19.0
[options.packages.find] [options.packages.find]
where = src where = src