From 57e7cf70570abc3d83b31ef4ac0b5a42f8f586b1 Mon Sep 17 00:00:00 2001 From: Trash Panda Date: Tue, 17 Feb 2026 21:23:06 -0700 Subject: [PATCH] fix: Prevent clippy from running on changes that don't include rust code --- .pre-commit-config.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4f1cde71..ecedcf53 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -51,7 +51,13 @@ repos: hooks: - id: cargo-clippy name: cargo clippy - entry: cargo +nightly clippy -- -D warnings + entry: > + sh -c ' + if [ "$(git diff HEAD @{u} | grep -G -- "^--- a/.*\.rs\$")" != "" ]; + then + cargo +nightly clippy -- -D warnings; + fi + ' language: system pass_filenames: false always_run: true