From c12db5246d396976dcac6b60e17ac43e9df433ea Mon Sep 17 00:00:00 2001 From: Eklavya Sharma Date: Fri, 22 Jul 2016 01:53:35 +0530 Subject: [PATCH] Use separate exclude list for scripts. --- tools/run-mypy | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/tools/run-mypy b/tools/run-mypy index ec966fd117..bf4743db19 100755 --- a/tools/run-mypy +++ b/tools/run-mypy @@ -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,