Skip to content

Add reportMissingParameterType to pyrightconfig.stricter.json #8770

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

Merged
merged 4 commits into from
Sep 21, 2022
Merged
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 pyrightconfig.stricter.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"stubs/invoke",
"stubs/jmespath",
"stubs/jsonschema",
"stubs/keyboard",
"stubs/ldap3",
"stubs/Markdown",
"stubs/mock",
Expand Down Expand Up @@ -99,6 +98,7 @@
"strictSetInference": true,
"reportFunctionMemberAccess": "error",
"reportMissingModuleSource": "none",
"reportMissingParameterType": "error",
"reportMissingTypeStubs": "error",
"reportUnusedImport": "error",
"reportUnusedClass": "error",
Expand Down
2 changes: 1 addition & 1 deletion stubs/keyboard/keyboard/mouse.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class _MouseListener(_GenericListener):
) -> Literal[True]: ...
def listen(self) -> None: ...

def is_pressed(button: _MouseButton = ...): ...
def is_pressed(button: _MouseButton = ...) -> bool: ...
def press(button: _MouseButton = ...) -> None: ...
def release(button: _MouseButton = ...) -> None: ...
def click(button: _MouseButton = ...) -> None: ...
Expand Down
20 changes: 10 additions & 10 deletions stubs/pyinstaller/PyInstaller/building/build_main.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Referenced in: https://pyinstaller.org/en/stable/hooks.html?highlight=get_hook_config#PyInstaller.utils.hooks.get_hook_config
# Not to be imported during runtime, but is the type reference for hooks and analysis configuration

from _typeshed import StrPath
from _typeshed import Incomplete, StrPath
from collections.abc import Iterable
from typing import Any

Expand All @@ -13,17 +13,17 @@ class Analysis(Target):
def __init__(
self,
scripts: Iterable[StrPath],
pathex=...,
binaries=...,
datas=...,
hiddenimports=...,
hookspath=...,
pathex: Incomplete | None = ...,
binaries: Incomplete | None = ...,
datas: Incomplete | None = ...,
hiddenimports: Incomplete | None = ...,
hookspath: Incomplete | None = ...,
hooksconfig: dict[str, dict[str, Any]] | None = ...,
excludes=...,
runtime_hooks=...,
cipher=...,
excludes: Incomplete | None = ...,
runtime_hooks: Incomplete | None = ...,
cipher: Incomplete | None = ...,
win_no_prefer_redirects: bool = ...,
win_private_assemblies: bool = ...,
noarchive: bool = ...,
module_collection_mode=...,
module_collection_mode: Incomplete | None = ...,
) -> None: ...
23 changes: 16 additions & 7 deletions stubs/pyinstaller/PyInstaller/depend/analysis.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,26 @@

# The documentation explicitely mentions that "Normally you do not need to know about the module-graph."
# However, some PyiModuleGraph typed class attributes are still documented as existing in imphookapi.
from _typeshed import Incomplete
from _typeshed import Incomplete, StrPath, SupportsKeysAndGetItem
from collections.abc import Iterable
from typing_extensions import TypeAlias

from PyInstaller.lib.modulegraph.modulegraph import Alias, Node

_LazyNode: TypeAlias = Iterable[Node] | Iterable[str] | Alias | None
# from altgraph.Graph import Graph
_Graph: TypeAlias = Incomplete

class PyiModuleGraph: # incomplete
def __init__(
self,
pyi_homepath: str,
user_hook_dirs=...,
excludes=...,
path: Incomplete | None = ...,
replace_paths=...,
implies=...,
graph: Incomplete | None = ...,
user_hook_dirs: Iterable[StrPath] = ...,
excludes: Iterable[str] = ...,
*,
path: Iterable[str] | None = ...,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These and further args are keyword-only, since they're forwarded through **kwargs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't know keyword-only arguments were a thing. Thanks!

replace_paths: Iterable[tuple[StrPath, StrPath]] = ...,
implies: SupportsKeysAndGetItem[str, _LazyNode] | Iterable[tuple[str, _LazyNode]] = ...,
graph: _Graph | None = ...,
debug: int = ...,
) -> None: ...
2 changes: 2 additions & 0 deletions stubs/pyinstaller/PyInstaller/lib/modulegraph/modulegraph.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class Node:
def __ge__(self, other: _SupportsGraphident) -> bool: ...
def infoTuple(self) -> tuple[str]: ...

class Alias(str): ...

class BaseModule(Node):
filename: str
packagepath: str
Expand Down