mirror of https://github.com/zulip/zulip.git
Tools/mypy: Enforce typed generics in tools/run-mypy.
This adds the "--disallow-any=generics" option to run-mypy, which no longer permits: - inheriting from "list"; use "List[sometype]" (or a TypeVar) - generic types with no following square brackets specifying the type (even if initially 'Any') Any (and '...' for Callable) is a lot easier to search for than an absence of square brackets, and should improve overall typing quality.
This commit is contained in:
parent
790cd5e7c8
commit
fec59b29cd
|
@ -87,7 +87,8 @@ if not python_files:
|
||||||
extra_args = ["--check-untyped-defs",
|
extra_args = ["--check-untyped-defs",
|
||||||
"--follow-imports=silent",
|
"--follow-imports=silent",
|
||||||
"--scripts-are-modules",
|
"--scripts-are-modules",
|
||||||
"-i", "--cache-dir=var/mypy-cache"]
|
"-i", "--cache-dir=var/mypy-cache",
|
||||||
|
"--disallow-any=generics"]
|
||||||
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")
|
||||||
|
|
Loading…
Reference in New Issue