Skip to content

Commit 588a834

Browse files
bordeuxclaude
andcommitted
chore: skip QA checks in pre-commit when no Rust files changed
Only run cargo make qa when .rs, Cargo.toml, or Cargo.lock files are staged for commit. This speeds up commits for non-Rust changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 816b7e1 commit 588a834

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

.husky/pre-commit

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,14 @@ if [ -f .git/MERGE_HEAD ]; then
77
exit 0
88
fi
99

10-
# Run QA checks for regular commits
10+
# Check if any Rust files are staged for commit
11+
RUST_FILES=$(git diff --cached --name-only --diff-filter=ACMR | grep -E '\.(rs)$|^Cargo\.(toml|lock)$' || true)
12+
13+
if [ -z "$RUST_FILES" ]; then
14+
echo "No Rust files changed, skipping cargo make qa"
15+
exit 0
16+
fi
17+
18+
# Run QA checks for commits with Rust changes
19+
echo "Rust files changed, running cargo make qa..."
1120
cargo make qa

0 commit comments

Comments
 (0)