fix: Prevent clippy from running on changes that don't include rust code
This commit is contained in:
parent
1005585ccb
commit
57e7cf7057
1 changed files with 7 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue