From 736f244634ee328e26bf30a8e1489adc58b5e298 Mon Sep 17 00:00:00 2001 From: linsui Date: Mon, 21 Jun 2021 13:08:25 +0800 Subject: [PATCH 1/3] fix vscode setting --- .vscode/settings.json | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 6d3b59a0..da31cd7f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,20 +1,19 @@ { "python.formatting.blackArgs": [ - "--config pyproject.toml" + "--config=pyproject.toml" ], "python.formatting.provider": "black", "python.linting.banditEnabled": true, "python.linting.banditArgs": [ - "-r", "-ii", - "--ini .bandit", + "--ini=.bandit", ], "python.linting.enabled": true, "python.linting.mypyArgs": [ - "--config-file mypy.ini" + "--config-file=mypy.ini" ], "python.linting.mypyEnabled": true, - "python.linting.pycodestyleEnabled": true, + "python.linting.flake8Enabled": true, "python.linting.pylintArgs": [ "--rcfile=.pylint-rcfile" ], From e0461ca1bf06bcda2b19f7961e05b42f0825d743 Mon Sep 17 00:00:00 2001 From: linsui Date: Mon, 21 Jun 2021 13:09:13 +0800 Subject: [PATCH 2/3] Make lint max-line-length to 88 for black --- .pylint-rcfile | 2 ++ setup.cfg | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/.pylint-rcfile b/.pylint-rcfile index 8cc4c8d8..d32d90c4 100644 --- a/.pylint-rcfile +++ b/.pylint-rcfile @@ -43,3 +43,5 @@ good-names=i,j,k,ex,Run,f,fp # Maximum number of nested blocks for function / method body max-nested-blocks=5 +[FORMAT] +max-line-length=88 diff --git a/setup.cfg b/setup.cfg index 81bcf8af..67e7581d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -39,3 +39,11 @@ output_dir = locale [compile_catalog] domain = fdroidserver directory = locale + +[pycodestyle] +ignore = E203,W503 +max-line-length = 88 + +[flake8] +ignore = E203,W503 +max-line-length = 88 From 33137a85160f6c4fd0b76d78fc1c86dd28ca8aa8 Mon Sep 17 00:00:00 2001 From: linsui Date: Mon, 21 Jun 2021 13:10:06 +0800 Subject: [PATCH 3/3] ignore E203 for black --- hooks/pre-commit | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hooks/pre-commit b/hooks/pre-commit index dfd608f9..4acfe2b5 100755 --- a/hooks/pre-commit +++ b/hooks/pre-commit @@ -55,13 +55,16 @@ fi # We ignore the following PEP8 warnings # * E123: closing bracket does not match indentation of opening bracket's line # - Broken if multiple indentation levels start on a single line +# * E203: whitespace before ':' +# - E203 is not PEP 8 compliant and conflict with black # * E501: line too long (82 > 79 characters) # - Recommended for readability but not enforced # - Some lines are awkward to wrap around a char limit # * W503: line break before binary operator # - Quite pedantic -PEP8_IGNORE="E123,E501,W503" + +PEP8_IGNORE="E123,E203,E501,W503" err() { echo >&2 ERROR: "$@"