#!/bin/bash
## checks 'cargo clippy' for errors only
require git cargo

is_cargo_project || return 0
git_hook_matches "pre-commit" "pre-merge-commit" || return 0
git_branch_matches "devel" || return 0

function clippy_errors
{
    cargo clippy 2>&1 | tee /dev/stderr | awk '/error.*: /{exit 1}'
}

run_test clippy_errors
