From ab89664d90236c9b7c120975a42d457a8eca9b6f Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Tue, 27 Dec 2016 19:39:44 -0800 Subject: [PATCH] lint: Clean up main exclude list and move to pyflakes. --- tools/lint-all | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/tools/lint-all b/tools/lint-all index 4be64babd6..e750735b45 100755 --- a/tools/lint-all +++ b/tools/lint-all @@ -22,16 +22,11 @@ except ImportError as e: # Exclude some directories and files from lint checking EXCLUDED_FILES = """ api/integrations/perforce/git_p4.py -api/setup.py -docs/conf.py -docs/html_unescape.py -node_modules puppet/apt/.forge-release puppet/apt/README.md static/locale static/third zerver/migrations -zproject/dev_settings.py zproject/settings.py zproject/test_settings.py """.split() @@ -62,17 +57,18 @@ def check_pyflakes(options, by_lang): # pyflakes writes some output (like syntax errors) to stderr. :/ for pipe in (pyflakes.stdout, pyflakes.stderr): for ln in pipe: - if options.full or not \ + if options.full or not ( ('imported but unused' in ln or 'redefinition of unused' in ln or - ("zerver/models.py" in ln and - " undefined name 'bugdown'" in ln) or + # Our ipython startup pythonrc file intentionally imports * ("scripts/lib/pythonrc.py" in ln and " import *' used; unable to detect undefined names" in ln) or + # Special dev_settings.py import + "from .prod_settings_template import *" in ln or ("zerver/tornado/ioloop_logging.py" in ln and "redefinition of function 'instrument_tornado_ioloop'" in ln) or ("zephyr_mirror_backend.py:" in ln and - "redefinition of unused 'simplejson' from line" in ln)): + "redefinition of unused 'simplejson' from line" in ln))): sys.stdout.write(ln) failed = True return failed