pub fn finding_failure_code(finding: &ScanFinding) -> Option<EngineFailureCode>Expand description
What:
The code of a finding that is not a violation,
or nothing for a violation.
Option<EngineFailureCode> is “a code or nothing”;
{ .. } ignores a variant’s fields.
Why:
The scanner reports two things among its findings that are not matches:
a matcher
that failed,
and a pathname with a line break that it could not inspect.
Neither
says the candidate is clean and neither names a rule,
so each must end the pass
as an engine failure instead of being printed as a rule violation.
Both arrive
after the candidate was read,
so the cause is the policy’s machinery.
In TS you’d write (pseudocode):
function findingFailureCode(finding: ScanFinding): EngineFailureCode | undefined;