Skip to content

Commit a53e71b

Browse files
committed
Small improvements
1 parent 1bc72cf commit a53e71b

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

clazy.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ else
5454

5555
fi
5656

57-
output=$(clazy-standalone --checks="$CHECKS" -p="$DATABASE" \
57+
export CLAZY_CHECKS="$CHECKS"
58+
output=$(set -e; clazy-standalone -p="$DATABASE" \
5859
--header-filter="$HEADER_FILTER" --ignore-dirs="$IGNORE_DIRS" \
5960
"${options[@]}" "${extra_args[@]}" "${extra_args_before[@]}" "${files[@]}" 2>&1)
6061

@@ -77,10 +78,21 @@ echo "$output" | grep -E "$pattern" | while IFS= read -r line; do
7778
warning_message="${BASH_REMATCH[5]}"
7879
warning_code="${BASH_REMATCH[6]}"
7980

81+
counter=0
8082
if [[ "$relative_path" == /* ]]; then
8183
absolute_path=$relative_path
8284
else
83-
absolute_path=$(realpath "$DATABASE/$relative_path")
85+
for full_path in "${files[@]}"; do
86+
if [[ "$(basename "$full_path")" == "$relative_path" ]]; then
87+
absolute_path="$full_path"
88+
((counter++))
89+
fi
90+
done
91+
fi
92+
93+
# This is incredibly bad, but I don't know how to properly handle the clazy output yet
94+
if [ "$counter" -ne 1 ]; then
95+
continue
8496
fi
8597

8698
warning_key="${absolute_path}:${line_number}:${column_number}:${warning_code}"

0 commit comments

Comments
 (0)