repomatic.checks module

The outcome of one check, and how a check run reports it.

The repository lint, the workflow lint and the token probes all answer the same question about something they inspected: did it pass, did it fail, or could the check not tell. One result type serves all of them, so a reporter renders any of them the same way.

class repomatic.checks.CheckResult(passed, message)[source]

Bases: NamedTuple

Outcome of one check.

passed is tri-state: True on success, False on failure, None when the check could not run or does not apply (skipped). message is the human-readable line for both terminal output and annotations.

Create new instance of CheckResult(passed, message)

passed: bool | None

Alias for field number 0

message: str

Alias for field number 1

repomatic.checks.report_result(result, level=AnnotationLevel.WARNING)[source]

Print one check line, and annotate it when the check failed.

A pass prints ✓ and a skip prints ℹ, neither with an annotation. A failure goes through report_finding() at level.

Parameters:
Return type:

bool

Returns:

True when the check failed (passed is False), else False.