adr check: say what is wrong and how to fix it, in plain words, with no rule codes #492
Labels
No labels
breaking
bug
documentation
enhancement
epic
good first issue
help wanted
refactoring
resolution/duplicate
resolution/invalid
resolution/wontfix
security
severity/critical
severity/high
severity/low
severity/medium
status/abandoned
status/blocked
status/needs-decision
status/needs-info
status/needs-verification
testing
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
#496 Epic: adr tooling guides the author, not only fails
sixfold-space/madtea
Reference
sixfold-space/madtea#492
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What happens
A failing
adr checkprints one line per problem as<path>: <rule>: <message>:The rule codes (C1 to C11, T1) mean nothing to the reader.
adr check --helpsays it "runs the MADR rules C1 to C11 and T1", andmadt_help topic="adr"describes each rule by its code. Several messages say what is wrong but not what to do.Ask
adr check failed: N problems in M files.--json: each problem is{file, problem, fix}. If a script needs a stable key, add a readable one such asissue-still-open, in JSON only.Example:
Proposed text
---block that holds status, date, and decision-makers.# Titleline after the front matter.Acceptance
adrcontains a rule code.--jsoncarries{file, problem, fix}per problem.One more message to fix: with
--skip-remote-issues, a clean tree printsThe OK line says the records were "checked against the forge" right after the line that says they were not. When the forge part is skipped, the OK line must not claim it ran.
Found while writing ADR 0037: the link check treats Markdown link syntax inside a code span as a real link. A record that shows the supersede link form as example text, for example inline code containing
[ADR-0012](0012-x.md), fails withlink "0012-x.md" does not resolve. The link check should skip inline code and fenced code blocks.Scope change: the rule codes go out of the code too, not only out of the text people read. The body above says "The codes may stay as internal names in the code". That is dropped. A reader of
adr.gocannot tell whatmadrProblem(name, "C7", ...)checks.Each rule gets one plain name, used in the code, the output, the
--jsonkey, the tests, and the fixture names:file-namefront-matterstatusdatetitlerequired-sectionsunique-numberlinkssupersede-link-backno-template-textlinked-issuesindexAcceptance addition:
git grep -nE '"(C[0-9]+|T1)"' internal/finds nothing, and no comment refers to a rule by code.The fixture directories are already renamed to what they test (for example
testdata/madr/duplicate-number/), in a separate change.Still not done.
mainat1c9eea63has 39 rule-code string literals underinternal/(git grep -nE '"(C[0-9]+|T1)"' internal/), and the help text still says "C1-C11 + T1 checks below apply" (internal/mcp/tools_help.go:856).adr checkstill prints lines like this:The code spreads from there: I wrote "C11" into #632 because that is the only name the output gives the check. With this issue done, that check is
linked-issueseverywhere, and nobody has to look up what a code means.The rule codes go in the #634 change. Each rule takes its plain name from the table above, with one change: the rule that the table names
linked-issuesis nowdecision-issues, because after #634 it reads only a record'sDecision issues:list. The rest of this issue stays here: grouping the output by file, the--jsonshape, and the plain messages for the other rules.