1#!/usr/bin/env bash 2 3readonly output=$(git clang-format -v --diff) 4 5if [[ "$output" == *"no modified files to format"* ]]; then exit 0; fi 6if [[ "$output" == *"clang-format did not modify any files"* ]]; then exit 0; fi 7 8echo "ERROR: you need to run git clang-format on your commit" 9echo " git clang-format -f is potentially what you want" 10exit 1 11