lint: Clean up main exclude list and move to pyflakes.

This commit is contained in:
Tim Abbott 2016-12-27 19:39:44 -08:00
parent 92a62cccd3
commit ab89664d90
1 changed files with 5 additions and 9 deletions

View File

@ -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