Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mypy/message_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"'
Expand Down
2 changes: 1 addition & 1 deletion test-data/unit/check-errorcodes.test
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
14 changes: 7 additions & 7 deletions test-data/unit/check-flags.test
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand All @@ -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]
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion test-data/unit/check-python38.test
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down