Skip to content

Check

invoke_tasklib.check

Composite task that runs the read-only checks.

invoke_tasklib.check.NAMESPACE module-attribute

NAMESPACE = 'check'

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

invoke_tasklib.check.all_

all_(
    c: Context,
    *,
    keep_going: bool = False,
    only: str | None = None,
    skip: str | None = None,
) -> None

Run the main checks of the project.

The steps are the ones of tasklib.check.tasks (by default format-python, format-docstrings, lint, types, imports and unit), run in that order. The other steps are doctest, shell, spelling, docs and audit. None of them modifies a file (except the coverage reports of unit with tasklib.check.cov, which also enforces tasklib.test.cov_fail_under). By default the first failure stops the task; with keep_going every step is run and the failed ones are listed at the end.

Before any step is run, the tools that the selected steps need (the programs and modules of _STEPS) are looked up and all the missing ones are reported at once, with the code 127 and nothing run. With keep_going, only the steps that miss a tool are not run: they are reported as failed, with the missing tools as the reason.

Parameters:

Name Type Description Default
c Context

The invoke context.

required
keep_going bool

If True, run all the steps even if one fails.

False
only str | None

Comma-separated steps to run instead of the configured ones.

None
skip str | None

Comma-separated steps to leave out.

None

Raises:

Type Description
Exit

If a name of only or skip is unknown, if a tool of the selected steps is missing (code 127), or if keep_going is set and a step failed.

UnexpectedExit

If a step fails and keep_going is not set.