Documentation
¶
Overview ¶
Command adrlint enforces the architecture decision records under docs/decisions (adr-lint.yml's checker).
adrlint docs [--root r] [--base <git ref>] [dir] lint every NNNN-title.md in dir (default docs/decisions) adrlint pr --files <path> [--root r] [--dir dir] check a pull request's "Decision:" line
--root (default ".") is the tree being judged: dir resolves under it and, with --base, git runs as "git -C root". The workflow runs a checker built from the base branch with --root pointing at the pull request's checkout, so a pull request cannot change the rules it is judged by.
docs rules (each violation is one file:line: message line on stdout, all are reported):
a MADR front matter: status (proposed|accepted|rejected|deprecated|superseded by ADR-NNNN, optionally followed by ";" and a free-text note; an ADR-NNNN in the note must exist and be listed), date (YYYY-MM-DD) and decision-makers; a "superseded by ADR-NNNN" status must name an ADR file that exists and is listed in README.md b the first heading is "# <title>"; the "##" sections are present and in order; "### Consequences" and "### Confirmation" sit under Decision Outcome c README.md links every ADR and every README link to an ADR resolves; every relative link in an ADR resolves; numbers are unique (gaps are allowed: a number may be reserved by an in-flight PR) d no consumer vocabulary (see vocabRE; the front matter block is not checked); a line carrying <!-- adrlint:allow vocabulary --> is exempt e with --base: an ADR that was accepted at <ref> may change only its status line (to superseded by ADR-NNNN) and add or change a "Superseded by [..](..)" line, whose link must resolve to an existing ADR file
pr reads PR_BODY and PR_LABELS (comma-separated) from the environment and the changed paths, one per line, from --files. The body needs exactly one "Decision: none" or "Decision: ADR-NNNN" line; the ADR must exist, be listed in README.md and be among the changed paths (the pull request adds or changes that record); "none" on a change under a protected path (docs/decisions/ included) needs the "decision-confirmed" label.
Exit 0: ok. Exit 1: violations. Exit 2: usage or an unreadable input.