Skip to content

Types

invoke_tasklib.typecheck

Type-checking task (types.check).

The module is named typecheck so that it does not shadow the standard library module types; its namespace is types, see NAMESPACE.

invoke_tasklib.typecheck.NAMESPACE module-attribute

NAMESPACE = 'types'

The name of the namespace of the tasks of this module.

invoke_tasklib.typecheck.check

check(
    c: Context,
    *,
    complete: bool = False,
    args: str | None = None,
    paths: str | None = None,
    pyright_args: str | None = None,
) -> None

Check type hints.

The checker is tasklib.types.checker (ty by default, or pyright or mypy). Two modes are available:

  • fast (default): only the checker is used.
  • complete (--complete): pyright is also run after the checker, unless the checker is pyright.

Parameters:

Name Type Description Default
c Context

The invoke context.

required
complete bool

If True, run pyright after the checker.

False
args str | None

Extra arguments passed to the checker (not to the extra pyright run).

None
paths str | None

The files or directories to check instead of the project default, passed to the checker and pyright.

None
pyright_args str | None

Extra arguments passed to the extra pyright run. They are only used with complete.

None