Repository navigation
Expand file tree
/
Copy pathlefthook.yml
More file actions
37 lines (37 loc) · 1.83 KB
/
Copy pathlefthook.yml
File metadata and controls
37 lines (37 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# The pre-commit hook finishes in under 10 s: it reads the staged files only,
# except `types`. Build, the whole-tree lint, the Effect diagnostics, the
# steering-doc fences and the tests are `bun run gate`'s, which CI runs on every push and pull request;
# run it before a handoff.
pre-commit:
parallel: true
jobs:
# The guards read the index the commit is made from, in about 2 s. They
# run beside the fixers: a fix the fixers stage is formatting or an
# oxlint autofix, and the gate reads the committed tree again.
- name: guards
run: bun run guards
# `bun check` reports the same type errors as tsc, for every package in
# about 2 s, against the working tree. It does not load tsconfig
# `plugins`, so the Effect diagnostics stay with the gate's patched tsc.
- name: types
glob: "*.{ts,tsx}"
run: bun run typecheck:fast
# oxlint first, then the formatter, on the same staged files, so the
# formatter has the last word; each stages what it rewrote. oxlint and
# oxfmt check a path named on the command line even when
# `.oxlintignore` lists it, so the group excludes both deliberate fixture
# roots here; the rule fixtures and Gamut app contain intentional errors.
- name: lint+fmt
exclude:
- "packages/tooling/fixtures/**"
- "testbeds/gamut/fixture/**"
group:
piped: true
jobs:
- name: oxlint
glob: "*.{ts,tsx}"
run: env -u FORCE_COLOR NO_COLOR=1 bunx oxlint --ignore-path=.oxlintignore --report-unused-disable-directives-severity=error --no-error-on-unmatched-pattern --fix {staged_files}
stage_fixed: true
- name: oxfmt
run: env -u FORCE_COLOR NO_COLOR=1 bunx oxfmt --ignore-path=.oxlintignore --no-error-on-unmatched-pattern {staged_files}
stage_fixed: true