Skip to content

Commit 979783a

Browse files
committed
Introduce pre-commit config for flake8
1 parent ed4ee98 commit 979783a

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
run: |
1717
python -m pip install --upgrade pip
1818
pip install tox
19-
- name: Run lint 💅
19+
- name: Run pre-commit 💅
2020
run: tox
2121
env:
22-
TOXENV: flake8
22+
TOXENV: pre-commit

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
default_language_version:
2+
python: python3.8
3+
repos:
4+
- repo: https://github.com/PyCQA/flake8
5+
rev: 5.0.4
6+
hooks:
7+
- id: flake8
8+
additional_dependencies: [flake8-bugbear==22.7.1]

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727

2828
dev_requires = [
2929
"black==19.10b0",
30-
"flake8==3.7.9",
31-
"flake8-black==0.1.1",
32-
"flake8-bugbear==20.1.4",
30+
"flake8>=5,<6",
31+
"flake8-black==0.3.3",
32+
"flake8-bugbear==22.7.1",
3333
] + tests_require
3434

3535
setup(

tox.ini

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ deps = -e.[dev]
4545
commands =
4646
black --exclude "/migrations/" graphene_django examples setup.py --check
4747

48-
[testenv:flake8]
49-
basepython = python3.8
50-
deps = -e.[dev]
48+
[testenv:pre-commit]
49+
skip_install = true
50+
deps = pre-commit
5151
commands =
52-
flake8 graphene_django examples setup.py
52+
pre-commit run --all-files --show-diff-on-failure

0 commit comments

Comments
 (0)