Skip to content

ci: enforce oxlint/oxfmt in CI and a lefthook pre-commit hook#21

Merged
i11v merged 2 commits into
mainfrom
claude/admiring-hypatia-gd7r2f
Jun 21, 2026
Merged

ci: enforce oxlint/oxfmt in CI and a lefthook pre-commit hook#21
i11v merged 2 commits into
mainfrom
claude/admiring-hypatia-gd7r2f

Conversation

@i11v

@i11v i11v commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Follow-up to #20: actually enforce the linter and formatter, in CI and locally.

What

1. CI gates (ci: enforce lint and formatting checks)

  • Adds bun run lint (oxlint) and bun run fmt:check (oxfmt) right after bun install in both workflows — deploy.yml (production) and pr-preview.yml (PRs).
  • Placed before typecheck/test/build so the cheap static checks fail fast.

2. Pre-commit hook via Lefthook (build: add pre-commit hook via lefthook)

  • Uses Lefthook (dev dependency) to manage git hooks — the modern, dependency-light husky alternative (single Go binary, declarative config, no Node at hook time).
  • lefthook.yml declares a pre-commit hook that runs oxlint and oxfmt --check in parallel, mirroring the CI static checks. Bypass a run with git commit --no-verify.
  • Hooks install automatically via lefthook install, run from the existing prepare script on bun install (guarded with || true so a non-git install context can't break prepare).

Verification

  • Lefthook hook verified end-to-end: runs lint+format in parallel, passes on a clean tree and blocks an unformatted commit (exit 1). It ran live on both commits in this PR.
  • lint, fmt:check, typecheck, test (79), build:web, verify:pwa all green; bun install --frozen-lockfile in sync.

Note

After pulling this, contributors get the hook automatically on their next bun install (via prepare) — no manual setup. To enable immediately without reinstalling: bunx lefthook install.

🤖 Generated with Claude Code

https://claude.ai/code/session_014DWovxbG4A7Ebda7xhG9nA

@github-actions

github-actions Bot commented Jun 21, 2026

Copy link
Copy Markdown

🚀 Preview deployed: https://preview-21.tablo.run
fallback: https://tablo-pr-21.i11v.workers.dev

claude added 2 commits June 21, 2026 09:34
Run `bun run lint` (oxlint) and `bun run fmt:check` (oxfmt) right after
install in both the production deploy and PR preview workflows, so lint
and formatting violations fail fast before typecheck/test/build.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014DWovxbG4A7Ebda7xhG9nA
Manage git hooks with Lefthook (dev dependency) instead of a hand-rolled
core.hooksPath script. lefthook.yml declares a pre-commit hook that runs
oxlint and oxfmt --check in parallel, mirroring the CI static checks.
Lefthook installs the hooks via `lefthook install` from the `prepare`
script on `bun install` (guarded so a non-git context can't break it);
bypass a run with `git commit --no-verify`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014DWovxbG4A7Ebda7xhG9nA
@i11v i11v force-pushed the claude/admiring-hypatia-gd7r2f branch from 7691e05 to a9c47b5 Compare June 21, 2026 09:35
@i11v i11v changed the title ci: enforce oxlint/oxfmt in CI and a pre-commit hook ci: enforce oxlint/oxfmt in CI and a lefthook pre-commit hook Jun 21, 2026
@i11v i11v marked this pull request as ready for review June 21, 2026 11:50
@i11v i11v merged commit 3378ff2 into main Jun 21, 2026
2 checks passed
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.

2 participants