move flake8 config to its own config file

This commit is contained in:
Willi Ballenthin
2023-07-09 22:35:53 +02:00
parent 7fe738e28f
commit 106b12e2a4
2 changed files with 18 additions and 12 deletions

16
.github/flake8.ini vendored Normal file
View File

@@ -0,0 +1,16 @@
[flake8]
max-line-length = 120
extend-ignore =
# E203: whitespace before ':' (black does this)
E203,
# F401: `foo` imported but unused (prefer ruff)
F401,
# F811 Redefinition of unused `foo` (prefer ruff)
F811,
# E501 line too long (prefer black)
E501,
# B010 Do not call setattr with a constant attribute value
B010,
# G200 Logging statement uses exception in arguments
G200

View File

@@ -62,7 +62,6 @@ repos:
hooks:
- id: ruff
name: ruff
# ruff is fast, so run during commit
stages: [commit, push]
language: system
entry: ruff
@@ -80,21 +79,12 @@ repos:
hooks:
- id: flake8
name: flake8
# flake8 is kinda slow, so only run upon push, or like:
#
# pre-commit run flake8 --hook-stage push
stages: [commit, push]
language: system
entry: flake8
args:
- "--max-line-length=120"
# E203: whitespace before ':' (black does this)
# F401: `foo` imported but unused (prefer ruff)
# F811 Redefinition of unused `foo` (prefer ruff)
# E501 line too long (prefer black)
# B010 Do not call setattr with a constant attribute value
# G200 Logging statement uses exception in arguments
- "--extend-ignore=E203,F401,F811,E501,B010,G200"
- "--config"
- ".github/flake8.ini"
- "--extend-exclude"
- "capa/render/proto/capa_pb2.py"
- "capa/"