Skip to content

Let the per-file counts guards keep restate themselves with -u and name the line and number - #1201

Merged
felipesauer merged 4 commits into
mainfrom
make-count-guards-self-updating
Nov 12, 2026
Merged

felipesauer merged 4 commits into
mainfrom
make-count-guards-self-updating

Conversation

@felipesauer

Copy link
Copy Markdown
Member

The first outside contribution went red on an internal count a guard keeps by hand, which its author could neither see nor run.

Four guards keep a count per file (the import clauses per file, the commands each page hands over in two guards, the passages of the overwrite recipe per page). Now:

  • a count that moved fails with the file and line of the ledger and the number to write, plus the command that writes it;
  • pnpm vitest run <the guard's file> -u rewrites exactly those numbers in place, the way -u rewrites a golden;
  • a file with no line, a line with no file and a row that gains or loses a kind of count still fail: someone lists those on purpose, and -u never lets them in.

Kept by hand on purpose: the ledgers of reasons (the unwitnessed files, the allowed escapes, the instrument list of the rulers guard), whose point is the sentence a person writes.

CONTRIBUTING.md says a red count is fixed by the command it names and that a maintainer does it when the contributor cannot.

@felipesauer

Copy link
Copy Markdown
Member Author

Review verdict: approve (c5fa848). Each counting guard now fails with the file, the line and the number to write, and pnpm vitest run <file> -u rewrites only that number. The update mode is inert in CI, and a new file still has to be listed by a person. A test holds the detection path, so a plain run never rewrites a file. CI is green on main merged in.

@felipesauer
felipesauer merged commit b466ed2 into main Nov 12, 2026
27 checks passed
@felipesauer
felipesauer deleted the make-count-guards-self-updating branch November 12, 2026 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant