adrlint

command
v0.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2026 License: Apache-2.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
adrlint index [--write|--check] [--root r] [--dir dir]   print, write or verify docs/decisions/INDEX.md

--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), date (YYYY-MM-DD) and
   decision-makers; a "superseded by ADR-NNNN" status must name an ADR file that exists
b  the first heading is "# <title>"; the "##" sections are present and in order; "### Consequences" and
   "### Confirmation" sit under Decision Outcome
c  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). A record need not be listed in README.md: existing in the
   directory is the rule (ADR 0068; the README's table is frozen at 0066 and INDEX.md lists every record)
   docs/decisions/NEXT holds the next free number (highest + 1, four digits and a newline): a pull request that adds
   an ADR takes it and bumps NEXT (ADR 0070)
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 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.

index generates INDEX.md in dir from every NNNN-title.md's front matter and first heading (internal/adrindex): a table of number, title, status and date, sorted by number. Without a flag it prints the file; --write writes it; --check exits 1 when the file is missing or differs from what would be generated, naming the first difference.

Exit 0: ok. Exit 1: violations. Exit 2: usage or an unreadable input.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL