Use separate exclude list for scripts.

This commit is contained in:
Eklavya Sharma 2016-07-22 01:53:35 +05:30 committed by Tim Abbott
parent 102fcda4ab
commit c12db5246d
1 changed files with 18 additions and 3 deletions

View File

@ -44,6 +44,15 @@ exclude_py3 = """
zerver/lib/ccache.py
""".split()
exclude_scripts_common = """
""".split()
exclude_scripts_py2 = """
""".split()
exclude_scripts_py3 = """
""".split()
parser = argparse.ArgumentParser(description="Run mypy on files tracked by git.")
parser.add_argument('targets', nargs='*', default=[],
help="""files and directories to include in the result.
@ -73,10 +82,16 @@ else:
if args.all:
exclude = []
elif py_version == 2:
exclude = exclude_common + exclude_py2
elif args.scripts_only:
if py_version == 2:
exclude = exclude_scripts_common + exclude_scripts_py2
else:
exclude = exclude_scripts_common + exclude_scripts_py3
else:
exclude = exclude_common + exclude_py3
if py_version == 2:
exclude = exclude_common + exclude_py2
else:
exclude = exclude_common + exclude_py3
# find all non-excluded files in current directory
files_dict = lister.list_files(targets=args.targets, ftypes=['py', 'pyi'], use_shebang=args.scripts_only,