fix(lefthook): run prettier before markdownlint, and match root-level files #41
Inga granskare
Etiketter
Inga etiketter
area/backups
area/ci
area/control-panel
area/identity
area/infra
area/observability
area/payments
area/security
area/storage
area/web
blocked
needs-info
needs-triage
priority
high
priority
low
priority
medium
ready-for-implementation
type
bug
type
chore
type
docs
type
epic
type
feature
type
task
wontfix
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Inget förfallodatum satt.
Beroenden
Inga beroenden satta
Referens
bitborg/bitborg-auth-reconciler!41
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "fix/lefthook-glob-and-order"
Borttagning av en gren är permanent. Även om den borttagna grenen kan fortsätta existera en kort tid innan den faktiskt tas bort, kan det INTE ångras i de flesta fall. Vill du fortsätta?
Fixes three lefthook defects that share one root cause: lefthook's
**/does not match atdepth 0, and
package.json,README.mdand the tool configs all live at the repository root.The defects
**/package.jsonmatched nothing, so the "Sort package.json" job had never run, anywhereit was defined. Verified directly: with a real staged change to the root
package.jsonthe jobreports "no matching staged files" while
format(which has no glob) runs — the control thatshows the test harness was sound and the glob was not.
**/*.mdskipped every root-level markdown file, soREADME.md,CLAUDE.mdandCONTRIBUTING.mdwere never linted on commit.eslint.config.mjs,tsconfig.json,vitest.config.ts).Every glob now carries both a depth-0 and a nested pattern.
The ordering
markdownlint now runs after prettier. That matches CI, which already runs the prettier check
first, and the markdownlint config's own stated policy: "Disabled = Prettier owns it or noise;
kept = structural/semantic rules Prettier does not handle." Linting before formatting
contradicted it — a hand-written table failed
MD060on the first commit attempt and passed onthe second, once prettier had realigned it.
Reproduced in both directions on identical input:
Checked before switching anything on
package.jsonis sorted in this commit, so the newly-live job does not rewrite it inside someunrelated change later; the reordering is semantically identical, verified by comparing the
parsed objects rather than the text
The three shared jobs are now byte-identical across every repository. Repo-specific jobs are
unchanged.
Three defects with one root cause: lefthook's `**/` does not match at depth 0, and package.json, README.md and the tool configs all live at the repository root. - `**/package.json` matched nothing, so the "Sort package.json" job had never run anywhere it was defined. The glob is now ["package.json", "**/package.json"], and it takes {staged_files} so a workspace's nested manifests are sorted too. - `**/*.md` skipped every root-level markdown file, so README.md and friends were never linted on commit. Now ["*.md", "**/*.md"]. Checked first that the root markdown is already clean, so switching this on blocks nobody. - eslint's glob skipped the root config files (eslint.config.mjs, tsconfig.json, vitest.config.ts). Verified they pass before enabling it. Ordering: markdownlint now runs AFTER prettier, matching CI and the markdownlint config's own stated policy ("Disabled = Prettier owns it or noise; kept = structural/semantic rules Prettier does not handle"). Linting before formatting contradicted that: a hand-written table failed MD060 on the first attempt and passed on the second, once prettier had realigned it. Reproduced both ways — the old order exits 1 on a near-aligned table, the new order exits 0 and stages the aligned result. package.json is sorted in this commit so the newly-live job does not rewrite it inside some unrelated change later. The reordering is semantically identical, verified by comparing the parsed objects. The three shared jobs are now byte-identical across every repository; repo-specific jobs are unchanged.