aboutsummaryrefslogtreecommitdiff
path: root/kde-modules/kde-git-commit-hooks
diff options
context:
space:
mode:
Diffstat (limited to 'kde-modules/kde-git-commit-hooks')
-rwxr-xr-xkde-modules/kde-git-commit-hooks/clang-format.sh5
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