From a8301f43cacb7e0dd29b764c1c278835a50dc66c Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Mon, 25 May 2020 19:37:27 +0100 Subject: [PATCH] Update setup.cfg flake8 section - Add the _n gettext prefix as a builtin, resolves "F821 undefined name" - Include the main executable when running flake8 from the top directory without specifying files - Ignore E402,F401 module import violations for specific files --- setup.cfg | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 22c3d985..eedced86 100644 --- a/setup.cfg +++ b/setup.cfg @@ -19,8 +19,26 @@ ignore-bad-ideas = *.mo ignore = *.rej [flake8] -builtins = _ +filename = + *.py + ./linkchecker +builtins = + _ + _n max-line-length = 80 +per-file-ignores = +# In several files imports intentionally cause: +# E402: module level import not at top of file +# F401: module imported but unused + linkchecker: E402 + setup.py: E402 + linkcheck/__init__.py: E402,F401 + linkcheck/bookmarks/chrome.py: E402 + linkcheck/checker/httpurl.py: E402 + linkcheck/htmlutil/htmlsoup.py: E402 + linkcheck/parser/__init__.py: E402 + tests/__init__.py: F401 + extend-ignore = # https://pep8.readthedocs.org/en/latest/intro.html#error-codes # these are ignored by default: