@@ -1829,120 +1829,120 @@ x: A # E:4: Missing type parameters for generic type "A"
18291829[builtins fixtures/list.pyi]
18301830
18311831[case testDisallowAnyExplicitDefSignature]
1832- # flags: --disallow-any-explicit
1832+ # flags: --disallow-any-explicit --show-error-codes
18331833
18341834from typing import Any, List
18351835
1836- def f(x: Any) -> None: # E: Explicit "Any" is not allowed
1836+ def f(x: Any) -> None: # E: Explicit "Any" is not allowed [explicit-any]
18371837 pass
18381838
1839- def g() -> Any: # E: Explicit "Any" is not allowed
1839+ def g() -> Any: # E: Explicit "Any" is not allowed [explicit-any]
18401840 pass
18411841
1842- def h() -> List[Any]: # E: Explicit "Any" is not allowed
1842+ def h() -> List[Any]: # E: Explicit "Any" is not allowed [explicit-any]
18431843 pass
18441844[builtins fixtures/list.pyi]
18451845
18461846[case testDisallowAnyExplicitVarDeclaration]
1847- # flags: --disallow-any-explicit
1847+ # flags: --disallow-any-explicit --show-error-codes
18481848from typing import Any
1849- v: Any = '' # E: Explicit "Any" is not allowed
1850- w = '' # type: Any # E: Explicit "Any" is not allowed
1849+ v: Any = '' # E: Explicit "Any" is not allowed [explicit-any]
1850+ w = '' # type: Any # E: Explicit "Any" is not allowed [explicit-any]
18511851class X:
1852- y = '' # type: Any # E: Explicit "Any" is not allowed
1852+ y = '' # type: Any # E: Explicit "Any" is not allowed [explicit-any]
18531853
18541854[case testDisallowAnyExplicitGenericVarDeclaration]
1855- # flags: --disallow-any-explicit
1855+ # flags: --disallow-any-explicit --show-error-codes
18561856from typing import Any, List
1857- v: List[Any] = [] # E: Explicit "Any" is not allowed
1857+ v: List[Any] = [] # E: Explicit "Any" is not allowed [explicit-any]
18581858[builtins fixtures/list.pyi]
18591859
18601860[case testDisallowAnyExplicitInheritance]
1861- # flags: --disallow-any-explicit
1861+ # flags: --disallow-any-explicit --show-error-codes
18621862from typing import Any, List
18631863
1864- class C(Any): # E: Explicit "Any" is not allowed
1864+ class C(Any): # E: Explicit "Any" is not allowed [explicit-any]
18651865 pass
18661866
1867- class D(List[Any]): # E: Explicit "Any" is not allowed
1867+ class D(List[Any]): # E: Explicit "Any" is not allowed [explicit-any]
18681868 pass
18691869[builtins fixtures/list.pyi]
18701870
18711871[case testDisallowAnyExplicitAlias]
1872- # flags: --disallow-any-explicit
1872+ # flags: --disallow-any-explicit --show-error-codes
18731873from typing import Any, List
18741874
1875- X = Any # E: Explicit "Any" is not allowed
1876- Y = List[Any] # E: Explicit "Any" is not allowed
1875+ X = Any # E: Explicit "Any" is not allowed [explicit-any]
1876+ Y = List[Any] # E: Explicit "Any" is not allowed [explicit-any]
18771877
18781878def foo(x: X) -> Y: # no error
18791879 x.nonexistent() # no error
18801880 return x
18811881[builtins fixtures/list.pyi]
18821882
18831883[case testDisallowAnyExplicitGenericAlias]
1884- # flags: --disallow-any-explicit
1884+ # flags: --disallow-any-explicit --show-error-codes
18851885from typing import Any, TypeVar, Tuple
18861886
18871887T = TypeVar('T')
18881888
1889- TupleAny = Tuple[Any, T] # E: Explicit "Any" is not allowed
1889+ TupleAny = Tuple[Any, T] # E: Explicit "Any" is not allowed [explicit-any]
18901890
18911891def foo(x: TupleAny[str]) -> None: # no error
18921892 pass
18931893
1894- def goo(x: TupleAny[Any]) -> None: # E: Explicit "Any" is not allowed
1894+ def goo(x: TupleAny[Any]) -> None: # E: Explicit "Any" is not allowed [explicit-any]
18951895 pass
18961896[builtins fixtures/tuple.pyi]
18971897
18981898[case testDisallowAnyExplicitCast]
1899- # flags: --disallow-any-explicit
1899+ # flags: --disallow-any-explicit --show-error-codes
19001900from typing import Any, List, cast
19011901
19021902x = 1
1903- y = cast(Any, x) # E: Explicit "Any" is not allowed
1904- z = cast(List[Any], x) # E: Explicit "Any" is not allowed
1903+ y = cast(Any, x) # E: Explicit "Any" is not allowed [explicit-any]
1904+ z = cast(List[Any], x) # E: Explicit "Any" is not allowed [explicit-any]
19051905[builtins fixtures/list.pyi]
19061906
19071907[case testDisallowAnyExplicitNamedTuple]
1908- # flags: --disallow-any-explicit
1908+ # flags: --disallow-any-explicit --show-error-codes
19091909from typing import Any, List, NamedTuple
19101910
1911- Point = NamedTuple('Point', [('x', List[Any]), ('y', Any)]) # E: Explicit "Any" is not allowed
1911+ Point = NamedTuple('Point', [('x', List[Any]), ('y', Any)]) # E: Explicit "Any" is not allowed [explicit-any]
19121912[builtins fixtures/list.pyi]
19131913
19141914[case testDisallowAnyExplicitTypeVarConstraint]
1915- # flags: --disallow-any-explicit
1915+ # flags: --disallow-any-explicit --show-error-codes
19161916from typing import Any, List, TypeVar
19171917
1918- T = TypeVar('T', Any, List[Any]) # E: Explicit "Any" is not allowed
1918+ T = TypeVar('T', Any, List[Any]) # E: Explicit "Any" is not allowed [explicit-any]
19191919[builtins fixtures/list.pyi]
19201920
19211921[case testDisallowAnyExplicitNewType]
1922- # flags: --disallow-any-explicit
1922+ # flags: --disallow-any-explicit --show-error-codes
19231923from typing import Any, List, NewType
19241924
19251925# this error does not come from `--disallow-any-explicit` flag
1926- Baz = NewType('Baz', Any) # E: Argument 2 to NewType(...) must be subclassable (got "Any")
1927- Bar = NewType('Bar', List[Any]) # E: Explicit "Any" is not allowed
1926+ Baz = NewType('Baz', Any) # E: Argument 2 to NewType(...) must be subclassable (got "Any") [valid-newtype]
1927+ Bar = NewType('Bar', List[Any]) # E: Explicit "Any" is not allowed [explicit-any]
19281928[builtins fixtures/list.pyi]
19291929
19301930[case testDisallowAnyExplicitTypedDictSimple]
1931- # flags: --disallow-any-explicit
1931+ # flags: --disallow-any-explicit --show-error-codes
19321932from mypy_extensions import TypedDict
19331933from typing import Any
19341934
1935- M = TypedDict('M', {'x': str, 'y': Any}) # E: Explicit "Any" is not allowed
1935+ M = TypedDict('M', {'x': str, 'y': Any}) # E: Explicit "Any" is not allowed [explicit-any]
19361936M(x='x', y=2) # no error
19371937def f(m: M) -> None: pass # no error
19381938[builtins fixtures/dict.pyi]
19391939
19401940[case testDisallowAnyExplicitTypedDictGeneric]
1941- # flags: --disallow-any-explicit
1941+ # flags: --disallow-any-explicit --show-error-codes
19421942from mypy_extensions import TypedDict
19431943from typing import Any, List
19441944
1945- M = TypedDict('M', {'x': str, 'y': List[Any]}) # E: Explicit "Any" is not allowed
1945+ M = TypedDict('M', {'x': str, 'y': List[Any]}) # E: Explicit "Any" is not allowed [explicit-any]
19461946N = TypedDict('N', {'x': str, 'y': List}) # no error
19471947[builtins fixtures/dict.pyi]
19481948
0 commit comments