-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlefthook.yml
More file actions
123 lines (119 loc) · 3.83 KB
/
lefthook.yml
File metadata and controls
123 lines (119 loc) · 3.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
pre-commit:
parallel: false
commands:
# Priority 1: auto-fix formatting
format-rust:
priority: 1
glob: "**/*.rs"
run: cargo fmt
format-web:
priority: 1
glob: "pixles-web/**/*.{ts,tsx,js,jsx,json,jsonc,css}"
run: cd pixles-web && bunx biome format --write .
format-docs:
priority: 1
glob: "pixles-docs/**/*.{ts,tsx,js,jsx,json,jsonc,css,astro,md,mdx}"
run: cd pixles-docs && bunx biome format --write .
format-kotlin:
priority: 1
glob: "**/*.{kt,kts}"
run: ./gradlew ktlintFormat
format-vision:
priority: 1
glob: "pixles-vision/**/*.py"
run: cd pixles-vision && uv run ruff format
format-swift:
priority: 1
glob: "pixles-swift/**/*.swift"
run: cd pixles-swift && swift run -c release --package-path BuildTools swiftformat .
skip:
- run: "[ \"$(uname)\" != \"Darwin\" ]"
# Priority 2: auto-fix linting
lint-web:
priority: 2
glob: "pixles-web/**/*.{ts,tsx,js,jsx,json,jsonc,css}"
run: cd pixles-web && bunx biome check --write .
lint-docs:
priority: 2
glob: "pixles-docs/**/*.{ts,tsx,js,jsx,json,jsonc,css,astro,md,mdx}"
run: cd pixles-docs && bunx biome check --write .
lint-vision:
priority: 2
glob: "pixles-vision/**/*.py"
run: cd pixles-vision && uv run ruff check --fix
# Priority 3: fail if any files changed (formatters/linters mutated staged files)
diff-check:
priority: 3
run: git diff --exit-code
fail_text: |
Formatters or linters modified staged files.
Review the changes with `git diff`, stage them with `git add`, then commit again.
pre-push:
parallel: false
commands:
# Priority 1: all format/lint checks (read-only, no writes)
format-check-rust:
priority: 1
glob: "**/*.rs"
run: cargo fmt --check
lint-check-rust:
priority: 1
glob: "**/*.rs"
run: cargo clippy --workspace --exclude pixles-sdk -- -D warnings
format-check-web:
priority: 1
glob: "pixles-web/**/*.{ts,tsx,js,jsx,json,jsonc,css}"
run: cd pixles-web && bunx biome format .
lint-check-web:
priority: 1
glob: "pixles-web/**/*.{ts,tsx,js,jsx,json,jsonc,css}"
run: cd pixles-web && bunx biome check .
format-check-docs:
priority: 1
glob: "pixles-docs/**/*.{ts,tsx,js,jsx,json,jsonc,css,astro,md,mdx}"
run: cd pixles-docs && bunx biome format .
lint-check-docs:
priority: 1
glob: "pixles-docs/**/*.{ts,tsx,js,jsx,json,jsonc,css,astro,md,mdx}"
run: cd pixles-docs && bunx biome check .
format-check-kotlin:
priority: 1
glob: "**/*.{kt,kts}"
run: ./gradlew ktlintCheck
lint-check-kotlin:
priority: 1
glob: "**/*.{kt,kts}"
run: ./gradlew detekt
format-check-vision:
priority: 1
glob: "pixles-vision/**/*.py"
run: cd pixles-vision && uv run ruff format --check
lint-check-vision-ruff:
priority: 1
glob: "pixles-vision/**/*.py"
run: cd pixles-vision && uv run ruff check
lint-check-vision-ty:
priority: 1
glob: "pixles-vision/**/*.py"
run: cd pixles-vision && uv run ty check
format-check-swift:
priority: 1
glob: "pixles-swift/**/*.swift"
run: cd pixles-swift && swift run -c release --package-path BuildTools swiftformat --lint .
skip:
- run: "[ \"$(uname)\" != \"Darwin\" ]"
lint-check-swift:
priority: 1
glob: "pixles-swift/**/*.swift"
run: cd pixles-swift && swiftlint
skip:
- run: "[ \"$(uname)\" != \"Darwin\" ]"
# Priority 2: tests
test-rust:
priority: 2
glob: "**/*.rs"
run: cargo test --workspace --exclude pixles-sdk
test-web:
priority: 2
glob: "pixles-web/**/*.{ts,tsx,js,jsx}"
run: cd pixles-web && bun test