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:
NamedTupleOutcome of one check.
passedis tri-state:Trueon success,Falseon failure,Nonewhen the check could not run or does not apply (skipped).messageis the human-readable line for both terminal output and annotations.Create new instance of CheckResult(passed, message)
- 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 throughreport_finding()at level.- Parameters:
result (
CheckResult) – The check outcome to render.level (
AnnotationLevel) – Severity of a failure.
- Return type:
- Returns:
Truewhen the check failed (passed is False), elseFalse.