checks.exit_code

checks.exit_code(findings, strict=False)

The exit code of spotregen check for a list of findings.

Parameters

Name Type Description Default
findings list[Finding] The findings of run_checks. required
strict bool Also fail on warnings. False

Returns

Name Type Description
int int 1 if there is an error, or a warning and strict is set, else 0.

Examples

from spotregen import Finding
from spotregen.checks import exit_code

warning = Finding("warning", "DEL03", "core.calc", "no longer referenced")
print(exit_code([warning]), exit_code([warning], strict=True))
0 1