Repository navigation
Expand file tree
/
Copy pathlefthook.yml
More file actions
47 lines (43 loc) · 1.69 KB
/
Copy pathlefthook.yml
File metadata and controls
47 lines (43 loc) · 1.69 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
38
39
40
41
42
43
44
45
46
47
# Shared, version-controlled git hooks. https://lefthook.dev/configuration/
#
# Opt-in — nothing runs until you register the hook for your own clone:
# backend-only: uv run lefthook install (or: uv-run-lefthook-install)
# frontend: yarn hooks:install
#
# These jobs auto-fix what they can and re-stage the result (stage_fixed), so a
# commit only fails on issues that need a human (unfixable lint errors, etc.).
# CI (.github/workflows/verify.yml) still runs the check-only versions of the
# same tools as the actual gate.
#
# Already installed it and want to change your mind? See lefthook-local.yml.example
# and docs/development-tools.md#git-hooks-lefthook.
pre-commit:
parallel: true
jobs:
# ruff check --fix and ruff format both rewrite the same *.py files, so they
# can't run in parallel with each other (one's write can land mid-write of
# the other, or clobber the other's output). Piping them inside this group
# keeps them sequential while the group as a whole still runs in parallel
# with the frontend jobs below.
- name: backend:ruff
root: "backend/"
glob: "*.py"
group:
piped: true
jobs:
- name: backend:ruff-fix
run: uv run ruff check --fix {staged_files}
stage_fixed: true
- name: backend:ruff-format-fix
run: uv run ruff format {staged_files}
stage_fixed: true
- name: frontend:biome-fix
root: "frontend/"
glob: "*.{js,jsx,ts,tsx}"
run: yarn biome:fix {staged_files}
stage_fixed: true
- name: frontend:stylelint-fix
root: "frontend/"
glob: "*.{css,scss}"
run: yarn stylelint:fix {staged_files}
stage_fixed: true