diff --git a/mypy/message_registry.py b/mypy/message_registry.py index cfeb27b1a5c9..67fd3319b37e 100644 --- a/mypy/message_registry.py +++ b/mypy/message_registry.py @@ -127,7 +127,7 @@ def with_additional_msg(self, info: str) -> ErrorMessage: "Function is missing a return type annotation", codes.NO_UNTYPED_DEF ) ARGUMENT_TYPE_EXPECTED: Final = ErrorMessage( - "Function is missing a type annotation for one or more arguments", codes.NO_UNTYPED_DEF + "Function is missing a type annotation for one or more parameters", codes.NO_UNTYPED_DEF ) KEYWORD_ARGUMENT_REQUIRES_STR_KEY_TYPE: Final = ErrorMessage( 'Keyword argument only valid with "str" key type in call to "dict"' diff --git a/test-data/unit/check-errorcodes.test b/test-data/unit/check-errorcodes.test index 58f48144b3e5..c5bcf74b3092 100644 --- a/test-data/unit/check-errorcodes.test +++ b/test-data/unit/check-errorcodes.test @@ -382,7 +382,7 @@ def f(x): # E: Function is missing a type annotation [no-untyped-def] def g(x: int): # E: Function is missing a return type annotation [no-untyped-def] pass -def h(x) -> None: # E: Function is missing a type annotation for one or more arguments [no-untyped-def] +def h(x) -> None: # E: Function is missing a type annotation for one or more parameters [no-untyped-def] pass def gen(): # E: Function is missing a return type annotation [no-untyped-def] diff --git a/test-data/unit/check-flags.test b/test-data/unit/check-flags.test index 94aae547882f..5c77a3e81f0d 100644 --- a/test-data/unit/check-flags.test +++ b/test-data/unit/check-flags.test @@ -8,7 +8,7 @@ main:2: error: Function is missing a type annotation # flags: --disallow-untyped-defs def f(x) -> int: pass [out] -main:2: error: Function is missing a type annotation for one or more arguments +main:2: error: Function is missing a type annotation for one or more parameters [case testNoArgumentFunction] # flags: --disallow-untyped-defs @@ -63,7 +63,7 @@ async def f(): # E: Function is missing a return type annotation \ [case testAsyncUnannotatedArgument] # flags: --disallow-untyped-defs -async def f(x) -> None: # E: Function is missing a type annotation for one or more arguments +async def f(x) -> None: # E: Function is missing a type annotation for one or more parameters pass [builtins fixtures/async_await.pyi] [typing fixtures/typing-async.pyi] @@ -830,7 +830,7 @@ import standard, incomplete def incomplete(x) -> int: return 0 [file incomplete.py] -def incomplete(x) -> int: # E: Function is missing a type annotation for one or more arguments +def incomplete(x) -> int: # E: Function is missing a type annotation for one or more parameters return 0 [file mypy.ini] \[mypy] @@ -847,7 +847,7 @@ import standard, incomplete def incomplete(x) -> int: return 0 [file incomplete.py] -def incomplete(x) -> int: # E: Function is missing a type annotation for one or more arguments +def incomplete(x) -> int: # E: Function is missing a type annotation for one or more parameters return 0 [file pyproject.toml] \[tool.mypy] @@ -1555,7 +1555,7 @@ def g(m: Movie) -> Movie: def f(i: int): # E: Function is missing a return type annotation pass -def g(i) -> None: # E: Function is missing a type annotation for one or more arguments +def g(i) -> None: # E: Function is missing a type annotation for one or more parameters pass def h(i: int) -> int: # no error return i @@ -1582,7 +1582,7 @@ def f(i: int, s): [out] main:3: error: Function is missing a return type annotation -main:3: error: Function is missing a type annotation for one or more arguments +main:3: error: Function is missing a type annotation for one or more parameters [case testDisallowIncompleteDefsAttrsNoAnnotations] # flags: --disallow-incomplete-defs @@ -1609,7 +1609,7 @@ class Annotated: import attrs @attrs.define -class PartiallyAnnotated: # E: Function is missing a type annotation for one or more arguments +class PartiallyAnnotated: # E: Function is missing a type annotation for one or more parameters bar: int = attrs.field() baz = attrs.field() diff --git a/test-data/unit/check-python38.test b/test-data/unit/check-python38.test index 595ff95f44dc..55895e9c6c2b 100644 --- a/test-data/unit/check-python38.test +++ b/test-data/unit/check-python38.test @@ -116,7 +116,7 @@ def g(x: int): ... [case testPEP570ArgTypesMissing] # flags: --disallow-untyped-defs -def f(arg, /) -> None: ... # E: Function is missing a type annotation for one or more arguments +def f(arg, /) -> None: ... # E: Function is missing a type annotation for one or more parameters [case testPEP570ArgTypesBadDefault] def f(arg: int = "ERROR", /) -> None: ... # E: Incompatible default for argument "arg" (default has type "str", argument has type "int")