-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlefthook.yml
More file actions
116 lines (98 loc) · 2.48 KB
/
Copy pathlefthook.yml
File metadata and controls
116 lines (98 loc) · 2.48 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
pre-commit:
parallel: true
commands:
fix-whitespace:
file_types:
- text
exclude: "**/.*"
run: |
for file in {staged_files}; do
if [[ -f "$file" ]]; then
# Remove trailing whitespace (portable sed usage)
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' 's/[[:space:]]*$//' "$file"
else
sed -i 's/[[:space:]]*$//' "$file"
fi
# Ensure file ends with newline
if [[ -s "$file" ]] && [[ $(tail -c1 "$file" | wc -l) -eq 0 ]]; then
echo >> "$file"
fi
fi
done
stage_fixed: true
fmt:
glob: "*.rs"
run: cargo fmt --all
stage_fixed: true
toml-fmt:
glob: "*.toml"
run: taplo format {staged_files}
stage_fixed: true
docs-prettier:
root: docs/
glob: "*.{md,mdx,astro}"
run: pnpm format
stage_fixed: true
docs-check:
root: docs/
glob: "*.{md,mdx,astro,ts,js,json}"
run: pnpm check
clippy:
glob: "*.rs"
run: cargo clippy --all-targets --all-features
typos:
glob: "*.{rs,md,txt,toml,yml,yaml}"
run: typos {staged_files}
test:
glob: "*.rs"
run: cargo test
mcp-biome:
root: renamify-mcp/
glob: "*.{ts,js,json}"
run: biome check --write
stage_fixed: true
mcp-test:
root: renamify-mcp/
glob: "*.ts"
run: pnpm test
mcp-tsc:
root: renamify-mcp/
glob: "*.ts"
run: tsc --noEmit
vscode-biome:
root: renamify-vscode/
glob: "*.{ts,js,json}"
run: biome check --write
stage_fixed: true
# Too slow, just run this on CI
# vscode-test:
# root: renamify-vscode/
# glob: "*.ts"
# run: pnpm test
vscode-tsc:
root: renamify-vscode/
glob: "*.ts"
run: pnpm typecheck
shellcheck:
glob: "*.sh"
run: shellcheck {staged_files}
shellcheck-scripts:
glob: "**/scripts/*"
exclude: "*.md|*.txt|*.rs|*.toml|*.yml|*.yaml|*.json"
run: |
for file in {staged_files}; do
if head -n 1 "$file" | grep -qE '^#!/(usr/)?bin/(ba)?sh' || [[ "$file" =~ \.sh$ ]]; then
shellcheck "$file"
fi
done
# pre-push:
# commands:
# test-all:
# run: cargo test --release
# check-docs:
# run: cargo doc --no-deps --all-features
# Skip lefthook installation on CI
skip_output:
- meta
- execution