Commit 9e43694
Improve pre-commit hook performance and usability
This commit addresses performance concerns and improves the developer
experience with the pre-commit hook based on community feedback.
Key improvements:
- Hook now runs only affected spec files (not entire test suite)
* Maps lib/package_json/foo.rb to spec/package_json/foo_spec.rb
* Includes any directly modified spec files
* Results in sub-second test runs for most commits
- Added hook version management (v1.0.0) for future updates
- Integrated hook installation into bin/setup for automatic setup
- Improved README documentation with clearer expectations
- Hook still runs RuboCop on staged files only (fast feedback)
Performance impact:
- Before: 4+ minutes (full test suite on every commit)
- After: <5 seconds for typical changes (affected tests only)
- CI still runs full test suite to catch any issues
Developer workflow:
- Pre-commit: Fast checks on changed files only
- Pre-push/PR: Run full `bundle exec rubocop` and `bundle exec rspec`
- CI: Enforces all checks on entire codebase
This balances fast local feedback with comprehensive CI coverage,
reducing friction while maintaining code quality standards.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 363a587 commit 9e43694
3 files changed
+61
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
267 | | - | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
268 | 272 | | |
269 | 273 | | |
270 | 274 | | |
271 | 275 | | |
272 | 276 | | |
273 | | - | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
274 | 290 | | |
275 | | - | |
276 | | - | |
| 291 | + | |
277 | 292 | | |
278 | | - | |
| 293 | + | |
279 | 294 | | |
280 | 295 | | |
281 | 296 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
8 | 12 | | |
9 | 13 | | |
10 | 14 | | |
| |||
20 | 24 | | |
21 | 25 | | |
22 | 26 | | |
| 27 | + | |
23 | 28 | | |
24 | 29 | | |
25 | 30 | | |
| |||
37 | 42 | | |
38 | 43 | | |
39 | 44 | | |
40 | | - | |
| 45 | + | |
41 | 46 | | |
42 | 47 | | |
43 | 48 | | |
44 | 49 | | |
45 | 50 | | |
46 | 51 | | |
47 | 52 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | 53 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
| 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 | + | |
57 | 81 | | |
58 | 82 | | |
59 | 83 | | |
| |||
64 | 88 | | |
65 | 89 | | |
66 | 90 | | |
| 91 | + | |
67 | 92 | | |
68 | 93 | | |
69 | | - | |
70 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
71 | 97 | | |
72 | 98 | | |
| 99 | + | |
| 100 | + | |
0 commit comments