Skip to content

Commit 1991321

Browse files
authored
Add pre-commit config for flake8 (#8068)
This makes it easier to lint your own work with `pre-commit`, but doesn't change the CI config by adding this to the pre-commit.ci skip list. There's no way to automatically reflect the additional dependencies from the requirements file, so the flake8 plugin list needs to be a verbatim copy. resolves #7991
1 parent 60c2733 commit 1991321

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.pre-commit-config.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,19 @@ repos:
99
hooks:
1010
- id: isort
1111
name: isort (python)
12+
- repo: https://github.com/pycqa/flake8
13+
rev: 4.0.1 # must match requirements-tests.txt
14+
hooks:
15+
- id: flake8
16+
additional_dependencies:
17+
# must match requirements-tests.txt
18+
- 'flake8-bugbear==21.11.29'
19+
- 'flake8-pyi==22.5.1'
1220

1321
ci:
1422
autofix_commit_msg: '[pre-commit.ci] auto fixes from pre-commit.com hooks'
1523
autofix_prs: true
1624
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
1725
autoupdate_schedule: weekly
18-
skip: []
26+
skip: [flake8]
1927
submodules: false

requirements-tests.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ mypy==0.960
22
pytype==2022.6.6; platform_system != "Windows"
33
# must match .pre-commit-config.yaml
44
black==22.3.0
5+
# must match .pre-commit-config.yaml
56
flake8==4.0.1
67
flake8-bugbear==21.11.29
78
flake8-pyi==22.5.1

0 commit comments

Comments
 (0)