Skip to content

Commit

Permalink
Provide report for warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jsoref committed Apr 12, 2024
1 parent bd16416 commit 58cf295
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions unknown-words.sh
Expand Up @@ -372,7 +372,9 @@ comment_task() {
fewer_misspellings_canary="$(mktemp)"
quit_without_error=1
get_has_errors
if [ -z "$has_errors" ] && [ -z "$patch_add" ]; then
if [ -z "$has_errors" ] &&
[ -z "$patch_add" ] &&
[ -z "$has_warnings" ]; then
quit
fi
check_spelling_report
Expand Down Expand Up @@ -2388,10 +2390,21 @@ get_action_log_overview() {

get_has_errors() {
if [ -z "$has_errors" ] &&
[ -s "$counter_summary_file" ] &&
jq -r 'keys | .[]' "$counter_summary_file" |
grep -q -E -v "$warnings_and_notices_list" 2> /dev/null; then
has_errors=1
[ -s "$counter_summary_file" ] &&
[ -z "$counter_summary_keys" ]; then
counter_summary_keys=$(mktemp_json)
jq -r 'keys | .[]' "$counter_summary_file" > "$counter_summary_keys"
if grep -E -q -v "$warnings_and_notices_list" "$counter_summary_keys" 2> /dev/null; then
has_errors=1
elif grep -E -q "$(
echo "$INPUT_WARNINGS" | events_to_regular_expression
)" "$counter_summary_keys" 2> /dev/null; then
has_warnings=1
elif grep -E -q "$(
echo "$INPUT_NOTICES" | events_to_regular_expression
)" "$counter_summary_keys" 2> /dev/null; then
has_notices=1
fi
fi
}

Expand Down

0 comments on commit 58cf295

Please sign in to comment.