From 106b12e2a4873f48a68b5bc5b3e2ca3b1d695191 Mon Sep 17 00:00:00 2001 From: Willi Ballenthin Date: Sun, 9 Jul 2023 22:35:53 +0200 Subject: [PATCH] move flake8 config to its own config file --- .github/flake8.ini | 16 ++++++++++++++++ .pre-commit-config.yaml | 14 ++------------ 2 files changed, 18 insertions(+), 12 deletions(-) create mode 100644 .github/flake8.ini diff --git a/.github/flake8.ini b/.github/flake8.ini new file mode 100644 index 00000000..f501ea67 --- /dev/null +++ b/.github/flake8.ini @@ -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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3cc774f0..dbc6e80f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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/"