From ea94e396e92e890eecea20b32fe9553ae2708078 Mon Sep 17 00:00:00 2001 From: Adam Dobrowolski Date: Thu, 15 Apr 2021 08:52:21 +0200 Subject: [PATCH] [EGD-5238] Fix ignored files breaking the script File ignored were passed with Ignore text making script return error --- config/clang_check.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/config/clang_check.sh b/config/clang_check.sh index f7176d519778217aae51bf6ceee478365635a175..c71bc30ba9642615b41de4b46331d8be90679e6c 100755 --- a/config/clang_check.sh +++ b/config/clang_check.sh @@ -26,10 +26,11 @@ get_files_to_check() { local files local endlist=() + local file_with_ignores="$1" files=$(git diff -U0 --name-only remotes/origin/master...HEAD) for file in ${files}; do - if [[ ${file} =~ ^.*\.(cpp|hpp|c|h|cxx|gcc|cc)$ ]] && shouldnt_ignore "${file}"; then + if [[ ${file} =~ ^.*\.(cpp|hpp|c|h|cxx|gcc|cc)$ ]] && shouldnt_ignore "${file}" > "$file_with_ignores"; then endlist+=("$file") fi done @@ -56,7 +57,11 @@ main() tool=$(get_clang_tidy) local files_to_check - files_to_check=$(get_files_to_check) + local ignore_files + ignore_files=$(mktemp /tmp/clang_check.XXXXXX) + + files_to_check=$(get_files_to_check "$ignore_files") + cat "$ignore_files" && rm "$ignore_files" if [[ -z $files_to_check ]]; then echo "no files to check"