-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlefthook.yml
More file actions
34 lines (33 loc) · 1.07 KB
/
lefthook.yml
File metadata and controls
34 lines (33 loc) · 1.07 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
# frozen_string_literal: true
pre-commit:
parallel: false
commands:
lint-fix:
run: bundle exec rake standard:fix
stage_fixed: true
tests:
run: |
specs=$(.lefthook/map_specs.rb)
if [ -n "$specs" ]; then
echo "Running specs for changed files..."
bundle exec rspec $specs --format progress
else
echo "No changed lib/ files, skipping tests"
fi
quality-review:
run: |
if [ -n "$CLAUDECODE" ]; then
echo "Inside Claude Code session, skipping quality-review hook (run /review-commit manually)"
exit 0
fi
staged_ruby=$(git diff --cached --name-only --diff-filter=ACM | grep '\.rb$' || true)
if [ -n "$staged_ruby" ]; then
echo "Running quality review on staged changes..."
claude -p "/review-commit" \
--no-session-persistence \
--model haiku \
--allowedTools "Bash Read Grep Glob" \
--no-chrome
else
echo "No Ruby files staged, skipping quality review"
fi