checks.typing.TypingCheck
checks.typing.TypingCheck()Run type checking tools on the package.
Executes a configurable static type checker to verify type annotations. Supports mypy (default) and pyright.
Attributes
name :-
The check identifier (“typing”).
description :-
Human-readable description of this check.
SUPPORTED_TOOLS :-
List of supported type checking tools.
Examples
Run type checking with default settings (mypy):
>>> from pathlib import Path
>>> check = TypingCheck()
>>> result = check.run(Path("."), {"enabled": True})
>>> result.name
'typing'Configure to use pyright:
>>> config = {"enabled": True, "tool": "pyright"}
>>> result = check.run(Path("."), config)Enable strict mode:
>>> config = {"enabled": True, "strict": True}
>>> result = check.run(Path("."), config)Methods
| Name | Description |
|---|---|
| run | Run type checking on the package. |
run
checks.typing.TypingCheck.run(package_path, config)Run type checking on the package.
Executes the configured type checker and collects any errors found. Errors are reported in the result details (limited to first 10).
Parameters
Returns
: CheckResult-
A CheckResult with:
: CheckResult-
- OK status if no type errors found
: CheckResult-
- ERROR status if type errors found or checker fails
: CheckResult-
- SKIPPED status if the type checker is not installed