CATALOGUEconstconst CATALOGUE: Readonly<Record<string, Explanation>>The explanation of every code, by code.
The problem codes of ergonex and what each means (commons 0001-ergonex FR-010; commons headless 0003-headless-output FR-008): every rule that can make a finding is a stable code (E- and the rule's words in capitals), and ergonex explain <code> says what happened, the likely cause and the fix. The catalogue is Headless' data of the program: the mechanism that finds, translates and writes an explanation is Headless', the words are Ergonex's.
A rule is ergonex/<words> (or changes/<words> for a commit message, which commons 0020-ifccm owns), and its code is E- and the words, upper-case, joined by dashes: ergonex/repository-diverged is E-REPOSITORY-DIVERGED. A rule that is made from a word of a union (ergonex/tool-too-old) is one entry for each word. tests prove that every rule written in the sources has an entry here.
import { codeOfRule } from "./catalogue.ts";
codeOfRule("ergonex/repository-diverged"); // "E-REPOSITORY-DIVERGED"CATALOGUEconstconst CATALOGUE: Readonly<Record<string, Explanation>>The explanation of every code, by code.
codeOfRulefunctionfunction codeOfRule(ruleId: string): stringThe code of a rule: E- and the rule's words in capitals, joined by dashes.