fix: format sources and add lefthook pre-push validation #20

Merged
alex merged 1 commit from pi/issue19-1785873839405 into master 2026-08-04 20:09:50 +00:00
Contributor

Summary

CI was failing because deno fmt --check flagged two files. This fixes the formatting and adds a Lefthook pre-push hook so broken changes can't be pushed locally before passing CI.

Fixes #19

Changes

Formatting fixes (unblock CI)

  • src/mutex.ts — was missing a trailing newline (the only code file flagged).
  • README.md — a few prose lines exceeded the 80-column wrap width; deno fmt reflowed them.

Lefthook pre-push hook

  • New lefthook.yml with a pre-push hook that runs the exact same checks CI enforces:
    • deno fmt --check
    • deno lint
    • deno check src/main.ts
    • deno test --allow-env --allow-read --allow-write
  • Commands run in parallel for speed; if any fails the push is aborted, so a change can only be pushed once it passes locally first.
  • Documented the hook in the README under a new Git hooks section (lefthook install to activate).

Verification

All CI steps pass locally:

  • deno fmt --check → 43 files OK
  • deno lint → 32 files clean
  • deno check src/main.ts → OK
  • deno test → 243 passed, 0 failed

Notes

  • The hook requires the lefthook binary and a one-time lefthook install (documented in the README).
  • Fallow dead-code analysis is intentionally not part of the hook — it's a heavy Node/npx tool that downloads on each run, so it's left as the separate manual deno task fallow step, mirroring how the README documents it.
## Summary CI was failing because `deno fmt --check` flagged two files. This fixes the formatting and adds a Lefthook `pre-push` hook so broken changes can't be pushed locally before passing CI. Fixes #19 ## Changes ### Formatting fixes (unblock CI) - `src/mutex.ts` — was missing a trailing newline (the only code file flagged). - `README.md` — a few prose lines exceeded the 80-column wrap width; `deno fmt` reflowed them. ### Lefthook pre-push hook - New [`lefthook.yml`](./lefthook.yml) with a `pre-push` hook that runs the exact same checks CI enforces: - `deno fmt --check` - `deno lint` - `deno check src/main.ts` - `deno test --allow-env --allow-read --allow-write` - Commands run in parallel for speed; if **any** fails the push is aborted, so a change can only be pushed once it passes locally first. - Documented the hook in the README under a new **Git hooks** section (`lefthook install` to activate). ## Verification All CI steps pass locally: - `deno fmt --check` → 43 files OK - `deno lint` → 32 files clean - `deno check src/main.ts` → OK - `deno test` → 243 passed, 0 failed ## Notes - The hook requires the `lefthook` binary and a one-time `lefthook install` (documented in the README). - Fallow dead-code analysis is intentionally **not** part of the hook — it's a heavy Node/npx tool that downloads on each run, so it's left as the separate manual `deno task fallow` step, mirroring how the README documents it.
fix: format sources and add lefthook pre-push validation
All checks were successful
PR / fallow (pull_request) Successful in 15s
PR / deno (pull_request) Successful in 45s
Build and Push Container Image / build-and-push-1 (push) Successful in 46s
Build and Push Container Image / build-and-push (push) Successful in 0s
Build and Push Container Image / deploy-1 (push) Successful in 4s
Build and Push Container Image / deploy (push) Successful in 0s
b1321990f0
Co-authored-by: alex <alex@forge.l3x.in>
alex merged commit b1321990f0 into master 2026-08-04 20:09:50 +00:00
alex deleted branch pi/issue19-1785873839405 2026-08-04 20:09:50 +00:00
Sign in to join this conversation.
No reviewers
No labels
dependencies
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
alex/irc-greeter-bot!20
No description provided.