~aleteoryx/muditaos

ea94e396e92e890eecea20b32fe9553ae2708078 — Adam Dobrowolski 5 years ago d4b06f4
[EGD-5238] Fix ignored files breaking the script

File ignored were passed with Ignore text making script return error
1 files changed, 7 insertions(+), 2 deletions(-)

M config/clang_check.sh
M config/clang_check.sh => config/clang_check.sh +7 -2
@@ 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"