30cargo-clippy-strict
1 #!/bin/bash 2 ## checks 'cargo clippy' for warnings and errors 3 require git cargo 4 is_cargo_project || return 0 5 git_hook_matches "pre-commit" "pre-merge-commit" || return 0 6 git_branch_matches "master" "main" || return 0 7 8 function clippy_strict 9 { 10 cargo clippy 2>&1 | tee /dev/stderr | awk '/(warning|error).*: /{exit 1}' 11 } 12 13 run_test clippy_strict