diff --git a/tools/run-mypy b/tools/run-mypy index 5cbbcb4077..d23f8300ae 100755 --- a/tools/run-mypy +++ b/tools/run-mypy @@ -24,29 +24,31 @@ zproject/test_settings.py """.split() parser = argparse.ArgumentParser(description="Run mypy on files tracked by git.") -parser.add_argument('targets', nargs='*', default=[], +parser.add_argument('targets', nargs='*', help="""files and directories to include in the result. If this is not specified, the current directory is used""") -parser.add_argument('-m', '--modified', action='store_true', default=False, help='list only modified files') -parser.add_argument('-a', '--all', dest='all', action='store_true', default=False, +parser.add_argument('-m', '--modified', action='store_true', + help='list only modified files') +parser.add_argument('-a', '--all', action='store_true', help="""run mypy on all python files, ignoring the exclude list. This is useful if you have to find out which files fail mypy check.""") -parser.add_argument('--linecoverage-report', dest='linecoverage_report', action='store_true', default=False, +parser.add_argument('--linecoverage-report', action='store_true', help="""run the linecoverage report to see annotation coverage""") -parser.add_argument('--no-disallow-untyped-defs', dest='disallow_untyped_defs', action='store_false', default=True, +parser.add_argument('--no-disallow-untyped-defs', + dest='disallow_untyped_defs', action='store_false', help="""Don't throw errors when functions are not annotated""") -parser.add_argument('--scripts-only', dest='scripts_only', action='store_true', default=False, +parser.add_argument('--scripts-only', action='store_true', help="""Only type check extensionless python scripts""") -parser.add_argument('--strict-optional', dest='strict_optional', action='store_true', default=False, +parser.add_argument('--strict-optional', action='store_true', help="""Use the --strict-optional flag with mypy""") -parser.add_argument('--warn-unused-ignores', dest='warn_unused_ignores', action='store_true', default=False, +parser.add_argument('--warn-unused-ignores', action='store_true', help="""Use the --warn-unused-ignores flag with mypy""") -parser.add_argument('--no-ignore-missing-imports', dest='ignore_missing_imports', action='store_false', default=True, +parser.add_argument('--no-ignore-missing-imports', + dest='ignore_missing_imports', action='store_false', help="""Don't use the --ignore-missing-imports flag with mypy""") -parser.add_argument('--quick', action='store_true', default=False, +parser.add_argument('--quick', action='store_true', help="""Use the --quick flag with mypy""") -parser.add_argument('--force', default=False, - action="store_true", +parser.add_argument('--force', action="store_true", help='Run tests despite possible provisioning problems.') args = parser.parse_args()