From fcc8fb5785e66675151758c5be9f239e58ae3b94 Mon Sep 17 00:00:00 2001
From: Tobias Hildebrandt <tobias.hildebrandt@savoirfairelinux.com>
Date: Mon, 20 Jun 2022 17:03:28 -0400
Subject: [PATCH] format.sh: only format real source files

ignore files that contain a C++ extension somewhere in their filename
but end with a different extension

Change-Id: Icbac5ace9d6e0eb4f7386751cb565e16045f97f4
---
 scripts/format.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/format.sh b/scripts/format.sh
index 55028dcf..2ef365b4 100755
--- a/scripts/format.sh
+++ b/scripts/format.sh
@@ -71,7 +71,7 @@ fi
 
 case "${1}" in
   --all )
-    files=$(find src -regex '.*\.\(cpp\|hpp\|cc\|cxx\|h\)') || true
+    files=$(find src -regex '.*\.\(cpp\|hpp\|cc\|cxx\|h\)$') || true
     echo Formatting all source files...
     format_files "$files"
     ;;
@@ -79,7 +79,7 @@ case "${1}" in
     install_hook "${2}"
     ;;
   * )
-    files=$(git diff-index --cached --name-only HEAD | grep -iE '\.(cpp|cxx|cc|h|hpp)') || exit_if_no_files
+    files=$(git diff-index --cached --name-only HEAD | grep -iE '\.(cpp|cxx|cc|h|hpp)$') || exit_if_no_files
     echo Formatting committed source files...
     format_files "$files"
     ;;
-- 
GitLab