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
#!/usr/bin/env bash
# Pre-commit hook for Rust projects
# Install: ln -sf ../../scripts/pre-commit .git/hooks/pre-commit
#
# Skip with: git commit --no-verify
# Or set: SKIP_PRECOMMIT=1
if [; then
fi
# 1. Format check (fast)
if ! ; then
fi
# 2. Filenames - no spaces or special chars
bad_files=
if [; then
fi
# 3. File sizes - no huge files (>1MB)
large_files=""
while ; do
if [; then
size=
if [; then
large_files=" "
fi
fi
done
if [; then
fi
# 4. No secrets (basic patterns)
secrets_found=
if [; then
else
fi