Skip to content

Commit ad74568

Browse files
authored
ci: run oxfmt + oxlint on pre-push (lefthook) (#4147)
Adds a lefthook `pre-push` job that runs the same checks as CI code-quality (`oxfmt --check .` + `oxlint .`), so formatting/lint failures are caught locally before they reach a PR. Uses the existing lefthook setup - no new tooling. Caveat noted in the config: GitButler uses its own git implementation and only runs hooks when "Run hooks" is enabled in its per-project settings; with that off, this protects plain `git push`. Enable that setting to have it fire on `but push` too.
1 parent 86235e5 commit ad74568

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

lefthook.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,14 @@ pre-commit:
44
jobs:
55
- name: 🚫 Prevent main branch commits
66
run: exit 1
7+
8+
# Mirror the CI code-quality check locally so unformatted / lint-failing pushes
9+
# are caught before they hit the PR. Note: GitButler uses its own git
10+
# implementation and only runs hooks when "Run hooks" is enabled in its
11+
# settings - with that off, this protects plain `git push` only.
12+
pre-push:
13+
jobs:
14+
- name: format
15+
run: pnpm exec oxfmt --check .
16+
- name: lint
17+
run: pnpm exec oxlint .

0 commit comments

Comments
 (0)