IF Commons GitHub

logical/findings

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0002-repoctl-governance FR-004

What a verb finds, as values (commons repoctl 0002-repoctl-governance FR-004): a finding has a level, a code of the closed union, a sentence that names its subject, and the command that fixes it. The Physical layer turns a finding into Headless' problem; nothing here knows how it is drawn.

import { finding } from "./findings.ts";
finding("fail", "E-STALE-GENERATED", "readme: README.md is stale", "bun commons/libraries/src/readme.ts").code; // "E-STALE-GENERATED"

Source: commons/repoctl/src/logical/findings.ts

1 of 8 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

logical.Leveltypeno test imports it
type Level = "fail" | "warn";

How serious a finding is: a failure fails the run, a warning does not.

logical.Findingtypeno test imports it
type Finding = { readonly level: Level; readonly code: ProblemCode; readonly message: string; readonly fix: string };

A finding: its level, its code, what is wrong and what to run.

logical.findingfunctionno test imports it
function finding(level: Level, code: ProblemCode, message: string, fix: string): Finding

A finding of the given level and code.

logical.tailLinesfunctionno test imports it
function tailLines(text: string, n: number): readonly string[]

The lines of a program's output that say something, without the blank ones and trimmed, at most n of them from the end.

Leveltypeno test imports it
type Level = "fail" | "warn";

How serious a finding is: a failure fails the run, a warning does not.

Findingtypeno test imports it
type Finding = { readonly level: Level; readonly code: ProblemCode; readonly message: string; readonly fix: string };

A finding: its level, its code, what is wrong and what to run.

findingfunctionno test imports it
function finding(level: Level, code: ProblemCode, message: string, fix: string): Finding

A finding of the given level and code.

tailLinesfunction
function tailLines(text: string, n: number): readonly string[]

The lines of a program's output that say something, without the blank ones and trimmed, at most n of them from the end.

Imported by 6 tests of the run (6 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.