changes.namedIssuesfunctionno test imports itfunction namedIssues(m: ParsedMessage): readonly string[]Every change request a message names, by a proper line or by a closing word, as owner/repo#N or #N, each once.
What a commit's message says of the change requests it serves (commons 0020-ifccm FR-005 to FR-008, FR-033): the lines Refs #N and Closes #N (or owner/repo#N for another repository), the words a Git host reads as closing an issue other than Closes, and the lines Departs: and Decision: that say a commit departs from a specification and which Decision authorizes it, and the line Impact: that says how much the change raises a version (major, minor or patch; commons 0026-works-versioning FR-021), which is read here so that a line that is none of the three can be found.
Pure text in, data out. A reference is read only from a line of its own: Closes #10 in the middle of a sentence is not read. The closing words a host reads (Fixes, Resolves, Closed, ...) are read wherever they stand, because the host reads them wherever they stand; the rule that reports them is rules.ts, never this module.
import { parseMessage } from "./commit-message.ts";
parseMessage("Add the check\n\nRefs #10\n").refs; // [{ kind: "refs", repo: undefined, number: 10, line: 3 }]changes.namedIssuesfunctionno test imports itfunction namedIssues(m: ParsedMessage): readonly string[]Every change request a message names, by a proper line or by a closing word, as owner/repo#N or #N, each once.
changes.parseMessagefunctionno test imports itfunction parseMessage(message: string): ParsedMessageA message's change requests, closing words, departures and Decisions. A line is read from its first non-space character; a quoted line (>) is not read.
changes.IssueReftypeno test imports ittype IssueRef = { readonly kind: ReferenceKind; readonly repo: string | undefined; readonly number: number; readonly line: number };A change request a commit names on a line of its own: its kind, the repository (owner/repo) where it is another's, its number and the line of the message.
changes.ParsedMessagetypeno test imports ittype ParsedMessage = {
/** The `Refs` and `Closes` lines, in order. */
readonly refs: readonly IssueRef[];
/** The… (620 characters)type ParsedMessage = {
/** The `Refs` and `Closes` lines, in order. */
readonly refs: readonly IssueRef[];
/** The closing words other than `Closes`, in order. */
readonly wrongWords: readonly WrongWord[];
/** The requirements (`NNNN-slug FR-nnn`) the `Departs:` lines name. */
readonly departs: readonly string[];
/** The identifiers the `Decision:` lines name. */
readonly decisions: readonly string[];
/** The `Impact:` lines whose value is not `major`, `minor` or `patch`: the value as written and the line. */
readonly badImpacts: readonly { readonly value: string; readonly line: number }[];
};A message as the check reads it.
changes.ReferenceKindtypeno test imports ittype ReferenceKind = "refs" | "closes";How a line names a change request (ifccm:IssueReferenceKind): refs while the capability is in progress, closes on the commit that finishes it.
changes.WrongWordtypeno test imports ittype WrongWord = { readonly word: string; readonly repo: string | undefined; readonly number: number; readonly line: number };A closing word a host reads that is not Closes: the word as written, the change request it names and the line.
namedIssuesfunctionfunction namedIssues(m: ParsedMessage): readonly string[]Every change request a message names, by a proper line or by a closing word, as owner/repo#N or #N, each once.
parseMessagefunctionfunction parseMessage(message: string): ParsedMessageA message's change requests, closing words, departures and Decisions. A line is read from its first non-space character; a quoted line (>) is not read.
IssueReftypeno test imports ittype IssueRef = { readonly kind: ReferenceKind; readonly repo: string | undefined; readonly number: number; readonly line: number };A change request a commit names on a line of its own: its kind, the repository (owner/repo) where it is another's, its number and the line of the message.
ParsedMessagetypeno test imports ittype ParsedMessage = {
/** The `Refs` and `Closes` lines, in order. */
readonly refs: readonly IssueRef[];
/** The… (620 characters)type ParsedMessage = {
/** The `Refs` and `Closes` lines, in order. */
readonly refs: readonly IssueRef[];
/** The closing words other than `Closes`, in order. */
readonly wrongWords: readonly WrongWord[];
/** The requirements (`NNNN-slug FR-nnn`) the `Departs:` lines name. */
readonly departs: readonly string[];
/** The identifiers the `Decision:` lines name. */
readonly decisions: readonly string[];
/** The `Impact:` lines whose value is not `major`, `minor` or `patch`: the value as written and the line. */
readonly badImpacts: readonly { readonly value: string; readonly line: number }[];
};A message as the check reads it.
ReferenceKindtypeno test imports ittype ReferenceKind = "refs" | "closes";How a line names a change request (ifccm:IssueReferenceKind): refs while the capability is in progress, closes on the commit that finishes it.
WrongWordtypeno test imports ittype WrongWord = { readonly word: string; readonly repo: string | undefined; readonly number: number; readonly line: number };A closing word a host reads that is not Closes: the word as written, the change request it names and the line.