diff options
| -rwxr-xr-x | kde-modules/kde-git-commit-hooks/clang-format.sh | 5 | 
1 files changed, 5 insertions, 0 deletions
| diff --git a/kde-modules/kde-git-commit-hooks/clang-format.sh b/kde-modules/kde-git-commit-hooks/clang-format.sh index d351e3cd..42a16a1d 100755 --- a/kde-modules/kde-git-commit-hooks/clang-format.sh +++ b/kde-modules/kde-git-commit-hooks/clang-format.sh @@ -4,6 +4,11 @@  readonly output=$(git clang-format -v --diff) +if [[ ! -f .clang-format ]]; then +    echo "ERROR: no .clang-format file found in repository root, abort format" +    echo "       run cmake for this repository to generate it" +    exit 1 +fi  if [[ "$output" == *"no modified files to format"* ]]; then exit 0; fi  if [[ "$output" == *"clang-format did not modify any files"* ]]; then exit 0; fi | 
