[ci] :bug: Fix file filtering function for clang-format styling
@@ -34,11 +34,11 @@ EXIT_STATUS=0
# Only check C and C++ files for clang-format compatibility
echo "Checking C/C++ files for clang-format compliance"
-clang_files=$(echo $files | tr ' ' '\n' | grep -P "(?<!\.ld)\.(h|c|cpp)\b")
+clang_files=$(echo "$files" | grep -P "(?<!\.ld)\.(h|c|cpp)\b")
# Remove files from dependencies
-clang_files=$(echo $clang_files | grep -vP "hardware/deps/")
-clang_files=$(echo $clang_files | grep -vP "toolchain/")
-clang_files=$(echo $clang_files | grep -vP "be/")
+clang_files=$(echo "$clang_files" | grep -vP "hardware/deps/")
+clang_files=$(echo "$clang_files" | grep -vP "toolchain/")
+clang_files=$(echo "$clang_files" | grep -vP "be/")
for file in $clang_files; do
echo $file
./.gitlab-ci.d/run_clang_format.py \
