mirror of https://github.com/zulip/zulip.git
mypy: Move remaining options on type-check semantics to config file.
This puts all of this config in one place, and also needs a lot fewer lines to describe it; which, combined, makes it a lot clearer what our normal config actually is. (I'd been looking at this script for a few minutes without realizing that we have `--disallow-untyped-defs` *on* by default, not off.) Experimenting with different values is still easy; just comment the line in the config.
This commit is contained in:
parent
cc9acbe50d
commit
9f3052b0ef
6
mypy.ini
6
mypy.ini
|
@ -6,14 +6,20 @@ cache_dir = var/mypy-cache
|
||||||
|
|
||||||
# Options to make the checking stricter.
|
# Options to make the checking stricter.
|
||||||
check_untyped_defs = True
|
check_untyped_defs = True
|
||||||
|
disallow_untyped_defs = True
|
||||||
disallow_any_generics = True
|
disallow_any_generics = True
|
||||||
warn_no_return = True
|
warn_no_return = True
|
||||||
strict_optional = True
|
strict_optional = True
|
||||||
no_implicit_optional = True
|
no_implicit_optional = True
|
||||||
|
|
||||||
|
# It's useful to try this occasionally, and keep it clean; but when
|
||||||
|
# someone fixes a type error we don't want to add a burden for them.
|
||||||
|
#warn_unused_ignores = True
|
||||||
|
|
||||||
# Options to make the checking *less* strict, which we
|
# Options to make the checking *less* strict, which we
|
||||||
# might ideally eliminate.
|
# might ideally eliminate.
|
||||||
follow_imports = silent
|
follow_imports = silent
|
||||||
|
ignore_missing_imports = True
|
||||||
|
|
||||||
|
|
||||||
# REQ returning None issue
|
# REQ returning None issue
|
||||||
|
|
|
@ -38,14 +38,6 @@ parser.add_argument('--force', action="store_true",
|
||||||
help="run tests despite possible provisioning problems")
|
help="run tests despite possible provisioning problems")
|
||||||
parser.add_argument('--linecoverage-report', action='store_true',
|
parser.add_argument('--linecoverage-report', action='store_true',
|
||||||
help="emit a coverage report under var/")
|
help="emit a coverage report under var/")
|
||||||
parser.add_argument('--no-disallow-untyped-defs',
|
|
||||||
dest='disallow_untyped_defs', action='store_false',
|
|
||||||
help="don't pass --disallow-untyped-defs to mypy")
|
|
||||||
parser.add_argument('--warn-unused-ignores', action='store_true',
|
|
||||||
help="pass --warn-unused-ignores to mypy")
|
|
||||||
parser.add_argument('--no-ignore-missing-imports',
|
|
||||||
dest='ignore_missing_imports', action='store_false',
|
|
||||||
help="don't pass --ignore-missing-imports to mypy")
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
if not args.force:
|
if not args.force:
|
||||||
|
@ -87,12 +79,6 @@ extra_args = []
|
||||||
if args.linecoverage_report:
|
if args.linecoverage_report:
|
||||||
extra_args.append("--linecoverage-report")
|
extra_args.append("--linecoverage-report")
|
||||||
extra_args.append("var/linecoverage-report")
|
extra_args.append("var/linecoverage-report")
|
||||||
if args.disallow_untyped_defs:
|
|
||||||
extra_args.append("--disallow-untyped-defs")
|
|
||||||
if args.warn_unused_ignores:
|
|
||||||
extra_args.append("--warn-unused-ignores")
|
|
||||||
if args.ignore_missing_imports:
|
|
||||||
extra_args.append("--ignore-missing-imports")
|
|
||||||
if args.quick:
|
if args.quick:
|
||||||
extra_args.append("--quick")
|
extra_args.append("--quick")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue