Introduce pre-commit config for flake8 (#1338)

This commit is contained in:
Ülgen Sarıkavak 2022-08-18 12:48:51 +03:00 committed by GitHub
parent ed4ee98596
commit 12ec3ca4ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 9 deletions

View File

@ -16,7 +16,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run lint 💅
- name: Run pre-commit 💅
run: tox
env:
TOXENV: flake8
TOXENV: pre-commit

8
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,8 @@
default_language_version:
python: python3.8
repos:
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
additional_dependencies: [flake8-bugbear==22.7.1]

View File

@ -27,9 +27,9 @@ tests_require = [
dev_requires = [
"black==19.10b0",
"flake8==3.7.9",
"flake8-black==0.1.1",
"flake8-bugbear==20.1.4",
"flake8>=5,<6",
"flake8-black==0.3.3",
"flake8-bugbear==22.7.1",
] + tests_require
setup(

View File

@ -45,8 +45,8 @@ deps = -e.[dev]
commands =
black --exclude "/migrations/" graphene_django examples setup.py --check
[testenv:flake8]
basepython = python3.8
deps = -e.[dev]
[testenv:pre-commit]
skip_install = true
deps = pre-commit
commands =
flake8 graphene_django examples setup.py
pre-commit run --all-files --show-diff-on-failure