fix: unbreak the ci format check and add lefthook hooks #3

Sammanfogat
supernaut sammanfogade 2 incheckningar från fix/ci-format-check in i main 2026-07-29 12:31:34 +00:00
Ägare

main was failing its own CI, and this repo had no pre-commit hooks to prevent that. Both
halves are fixed here: unbreak the check, then install the hooks that stop it recurring.

The breakage

pnpm format:check reported README.md as unformatted (markdown table column alignment in
the HTTP-surface table). Because ci runs on pull_request, every PR to this repo failed
the check — Renovate's chore(deps): pin dependency fta-cli to 3.0.0 (task #2) failed for this
reason, not because of the dependency change. The identical Renovate PR passed in
bitborg-auth-reconciler, which is what gave it away. With branch protection now requiring ci,
this had made the repo unmergeable.

The prevention

This repo had no lefthook at all — no config, no installed hooks — while bitborg-web,
bitborg-infra and bitborg-internal all have it. An unformatted file could therefore reach main
unnoticed, which is exactly what happened.

Changes

  • README.md — Prettier reformatting (whitespace only), plus a text language on the
    fenced block at line 15, which markdownlint's MD040 flags
  • .forgejo/workflows/ci.yml — header comment said "bitborg-auth-reconciler CI", a copy-paste
    leftover from the repo this scaffold came from
  • lefthook.json — modelled on bitborg-web's, minus the Astro/stylelint jobs. pre-commit
    runs prettier on staged files, markdownlint on staged *.md, eslint --fix on staged
    JS/TS/JSON, all stage_fixed: true. pre-push runs build and test.
  • .markdownlint-cli2.jsonc — copied verbatim from bitborg-internal/bitborg-infra
  • lefthook@2.1.10 + markdownlint-cli2@0.23.1 devDependencies, same pins as the other repos
  • pnpm-workspace.yaml — allowBuilds: { lefthook: true }. Required: without it pnpm
    blocks lefthook's postinstall, which is what installs the hooks, so they would silently never
    be installed.

Verified

All six CI steps pass locally (audit, typecheck, eslint, format:check, test, build);
markdownlint is clean (was 1 MD040 issue); pnpm install reports
sync hooks: ✔️(pre-push, pre-commit); the pre-commit hook ran on these commits and the
pre-push hook ran build and test on push.

Renovate's pin PR should go green on a rebase once this merges.

`main` was failing its own CI, and this repo had no pre-commit hooks to prevent that. Both halves are fixed here: unbreak the check, then install the hooks that stop it recurring. ## The breakage `pnpm format:check` reported `README.md` as unformatted (markdown table column alignment in the HTTP-surface table). Because `ci` runs on `pull_request`, **every** PR to this repo failed the check — Renovate's `chore(deps): pin dependency fta-cli to 3.0.0` (task #2) failed for this reason, not because of the dependency change. The identical Renovate PR passed in bitborg-auth-reconciler, which is what gave it away. With branch protection now requiring `ci`, this had made the repo unmergeable. ## The prevention This repo had no lefthook at all — no config, no installed hooks — while bitborg-web, bitborg-infra and bitborg-internal all have it. An unformatted file could therefore reach `main` unnoticed, which is exactly what happened. ## Changes - `README.md` — Prettier reformatting (whitespace only), plus a `text` language on the fenced block at line 15, which markdownlint's MD040 flags - `.forgejo/workflows/ci.yml` — header comment said "bitborg-auth-reconciler CI", a copy-paste leftover from the repo this scaffold came from - `lefthook.json` — modelled on bitborg-web's, minus the Astro/stylelint jobs. `pre-commit` runs prettier on staged files, markdownlint on staged `*.md`, eslint `--fix` on staged JS/TS/JSON, all `stage_fixed: true`. `pre-push` runs build and test. - `.markdownlint-cli2.jsonc` — copied verbatim from bitborg-internal/bitborg-infra - `lefthook@2.1.10` + `markdownlint-cli2@0.23.1` devDependencies, same pins as the other repos - `pnpm-workspace.yaml` — `allowBuilds: { lefthook: true }`. **Required:** without it pnpm blocks lefthook's postinstall, which is what installs the hooks, so they would silently never be installed. ## Verified All six CI steps pass locally (`audit`, `typecheck`, `eslint`, `format:check`, `test`, `build`); markdownlint is clean (was 1 MD040 issue); `pnpm install` reports `sync hooks: ✔️(pre-push, pre-commit)`; the pre-commit hook ran on these commits and the pre-push hook ran build and test on push. Renovate's pin PR should go green on a rebase once this merges.
supernaut lade till 1 incheckning 2026-07-29 12:16:30 +00:00
fix: unbreak the ci format check on main
Alla kontroller lyckades
ci / ci (pull_request) Successful in 19s
f5528e2fbb
supernaut lade till 1 incheckning 2026-07-29 12:29:04 +00:00
build: add lefthook pre-commit and pre-push hooks
Alla kontroller lyckades
ci / ci (pull_request) Successful in 23s
26377b63f5
supernaut ändrade titeln från fix: unbreak the ci format check on main till fix: unbreak the ci format check and add lefthook hooks 2026-07-29 12:29:37 +00:00
supernaut sammanfogade incheckning 5c28716a88 till main 2026-07-29 12:31:34 +00:00
Logga in för att delta i denna konversation.
Inga granskare
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Förfallodatumet är ogiltigt eller utanför gränserna. Använd formatet "åååå-mm-dd".

Inget förfallodatum satt.

Beroenden

Inga beroenden satta

Referens
bitborg/bitborg-reconcile-trigger!3
Ingen beskrivning angiven.