Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unnecessary "# pyright: ignore" rule: "reportUnknownMemberType #13393

Closed
wants to merge 7 commits into from
Closed
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
6 changes: 3 additions & 3 deletions lib/ts_utils/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@
assert isinstance(tools_settings, dict)
assert tools_settings.keys() <= _KNOWN_METADATA_TOOL_FIELDS.keys(), f"Unrecognised tool for {distribution!r}"
for tool, tk in _KNOWN_METADATA_TOOL_FIELDS.items():
settings_for_tool: object = tools_settings.get(tool, {}) # pyright: ignore[reportUnknownMemberType]
settings_for_tool: object = tools_settings.get(tool, {}) # pyright ignore reportUnknownMemberType

Check failure on line 283 in lib/ts_utils/metadata.py

View workflow job for this annotation

GitHub Actions / Run pyright against the scripts and tests directories (Windows)

Type of "get" is partially unknown   Type of "get" is "Overload[(key: Unknown, /) -> (Unknown | None), (key: Unknown, default: Unknown, /) -> Unknown, (key: Unknown, default: _T@get, /) -> (Unknown | _T@get)]" (reportUnknownMemberType)

Check failure on line 283 in lib/ts_utils/metadata.py

View workflow job for this annotation

GitHub Actions / Run pyright against the scripts and tests directories (Linux)

Type of "get" is partially unknown   Type of "get" is "Overload[(key: Unknown, /) -> (Unknown | None), (key: Unknown, default: Unknown, /) -> Unknown, (key: Unknown, default: _T@get, /) -> (Unknown | _T@get)]" (reportUnknownMemberType)
assert isinstance(settings_for_tool, dict)
for key in settings_for_tool:
assert key in tk, f"Unrecognised {tool} key {key!r} for {distribution!r}"
Expand Down Expand Up @@ -312,9 +312,9 @@
data = tomlkit.load(file)
except FileNotFoundError:
raise NoSuchStubError(f"Typeshed has no stubs for {distribution!r}!") from None
data.update(new_values) # pyright: ignore[reportUnknownMemberType] # tomlkit.TOMLDocument.update is partially typed
data.update(new_values) # pyright ignore reportUnknownMemberType # tomlkit.TOMLDocument.update is partially typed

Check failure on line 315 in lib/ts_utils/metadata.py

View workflow job for this annotation

GitHub Actions / Run pyright against the scripts and tests directories (Windows)

Type of "update" is partially unknown   Type of "update" is "Overload[(m: SupportsKeysAndGetItem[Unknown, Unknown], /, **kwargs: Unknown) -> None, (m: Iterable[tuple[Unknown, Unknown]], /, **kwargs: Unknown) -> None, (**kwargs: Unknown) -> None]" (reportUnknownMemberType)

Check failure on line 315 in lib/ts_utils/metadata.py

View workflow job for this annotation

GitHub Actions / Run pyright against the scripts and tests directories (Linux)

Type of "update" is partially unknown   Type of "update" is "Overload[(m: SupportsKeysAndGetItem[Unknown, Unknown], /, **kwargs: Unknown) -> None, (m: Iterable[tuple[Unknown, Unknown]], /, **kwargs: Unknown) -> None, (**kwargs: Unknown) -> None]" (reportUnknownMemberType)
with path.open("w", encoding="UTF-8") as file:
tomlkit.dump(data, file) # pyright: ignore[reportUnknownMemberType] # tomlkit.dump has partially unknown Mapping type
tomlkit.dump(data, file) # pyright ignore reportUnknownMemberType # tomlkit.dump has partially unknown Mapping type

Check failure on line 317 in lib/ts_utils/metadata.py

View workflow job for this annotation

GitHub Actions / Run pyright against the scripts and tests directories (Windows)

Type of "dump" is partially unknown   Type of "dump" is "(data: Mapping[Unknown, Unknown], fp: IO[str], *, sort_keys: bool = False) -> None" (reportUnknownMemberType)

Check failure on line 317 in lib/ts_utils/metadata.py

View workflow job for this annotation

GitHub Actions / Run pyright against the scripts and tests directories (Linux)

Type of "dump" is partially unknown   Type of "dump" is "(data: Mapping[Unknown, Unknown], fp: IO[str], *, sort_keys: bool = False) -> None" (reportUnknownMemberType)
return data


Expand Down
Loading