build: add lefthook pre-commit and pre-push hooks #2
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-payment!2
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "build/add-lefthook"
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?
This repo had no lefthook at all — no config and no installed hooks — while bitborg-web,
bitborg-infra and bitborg-internal all have it. That gap is not theoretical: it is how
bitborg-reconcile-trigger'smainended up with an unformattedREADME.mdthat failedits own
format:checkand, once branch protection landed, blocked every PR in that repo.Mirrors the existing setup rather than inventing one:
lefthook.json— modelled on bitborg-web's, minus the Astro/stylelint jobs this repohas no use for.
pre-commitruns prettier on staged files, markdownlint on staged*.md, and eslint--fixon staged JS/TS/JSON, all withstage_fixed: true.pre-pushruns build and test (bitborg-web additionally runs e2e; there is none here)..markdownlint-cli2.jsonc— copied verbatim from bitborg-internal/bitborg-infra, somarkdown rules stay consistent across the workspace.
lefthook@2.1.10+markdownlint-cli2@0.23.1devDependencies, pinned to the sameversions the other repos use.
pnpm-workspace.yaml—allowBuilds: { lefthook: true }. This one matters: withoutit pnpm blocks lefthook's postinstall, which is what installs the hooks, so they would
silently never be installed. pnpm actually stubbed the key in as
lefthook: set this to true or falseduring install.Verified end to end, not just configured:
pnpm installreportssync hooks: ✔️(pre-push, pre-commit), both hook files exist in.git/hooks/, thepre-commit hook ran on this very commit (format applied; the markdown and eslint jobs
correctly skipped for want of matching staged files), and the pre-push hook ran build and
test when this branch was pushed.
de5a2ce6e3a98d658baf