From 4557f2c9b425ec7b956433dd41b3393573e49bbd Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Tue, 12 Mar 2024 19:42:04 +0100 Subject: [PATCH] chore: fix/improve flake8 configuration Fix & improve a bit the configuration for flake8, so it can be run without issues: - drop all the old ignores, no more needed (all the issues where fixed) - drop the excludes for paths that are either do not exist anymore, or that it is not a problem to scan (e.g. "docs") - add the explicit filename patterns so "*.py.in" files are scanned too; adding ".py" is needed since "filename" replaces the default paths - set the same line length as used by black - add a couple of known ignores related to the style formatted by black - ignore longer lines in a couple of files; they are there already, and fixing them can be done gradually - exclude also the default meson build directory Signed-off-by: Pino Toscano --- .flake8 | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.flake8 b/.flake8 index 2f0db80e4..c18df0179 100644 --- a/.flake8 +++ b/.flake8 @@ -1,3 +1,19 @@ [flake8] -ignore = E501,E126,E127,E128,E722 -exclude = bin,docs,include,lib,lib64,.git +filename = + *.py, + *.py.in, +# same limit as black +max-line-length = 88 +ignore = + # E203 whitespace before ':' + # result of black-formatted code + E203, + # W503: line break before binary operator + W503 +per-file-ignores = + # some lines are longer than 88 + src/insights_client/__init__.py: E501 + integration-tests/test_unregister.py: E501 +extend-exclude = + # default build directory + build/,