Skip to content

Commit ca00491

Browse files
authored
feat: make printing info optional for zulip_build_report.sh (#23)
#19 removed info messages, but the weekly linting report in both Mathlib and CSLib make use of this (see leanprover-community/mathlib4#37236). Instead, make this an off by default option. I will follow up with Mathlib and CSLib PRs enabling this for the weekly linting reports.
1 parent db65dfd commit ca00491

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

scripts/reporting/zulip_build_report.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ target_sha=${TARGET_SHA:-${SHA:-${GITHUB_SHA}}}
77
workflow_repo=${WORKFLOW_REPO:-${REPO:-${GITHUB_REPOSITORY}}}
88
workflow_run_id=${WORKFLOW_RUN_ID:-${RUN_ID:-${GITHUB_RUN_ID}}}
99
workflow_name=${WORKFLOW:-${GITHUB_WORKFLOW}}
10+
info=${INFO:-false}
1011

1112
# Skip the lines about build progress.
1213
filtered_out=$(grep -v '^✔' "${lean_outfile}" | grep -v '^trace: ')
@@ -38,6 +39,8 @@ if warning_lines=$(grep '^warning: ' <<<"${filtered_out}"); then
3839
echo "$(wc -l <<<"${warning_lines}") lines of warnings" >&2
3940
fi
4041
if info_lines=$(grep '^info: ' <<<"${filtered_out}" | grep -v 'PANIC at '); then
42+
# shellcheck disable=SC2001 # The sed version is (hours!) faster than native Bash string manipulation.
43+
info_descriptions=$(sed 's/^info: [^:]*:[0-9]*:[0-9]*: //' <<<"${info_lines}")
4144
counts+=( "$(printf 'Info messages: %d' "$(wc -l <<<"${info_lines}")")" )
4245
echo "$(wc -l <<<"${info_lines}") lines of info" >&2
4346
fi
@@ -85,4 +88,13 @@ if [ -n "${warning_lines}" ]; then
8588
echo
8689
fi
8790

91+
if [ -n "${info_lines}" ] && [ "${info}" != "false" ]; then
92+
echo "\`\`\`spoiler Info message counts"
93+
echo "| | Info message |"
94+
echo "| ---: | --- |"
95+
sort <<<"${info_descriptions}" | uniq -c | sort -bgr | sed 's/^\( *[0-9][0-9]*\) \(.*\)$/| \1 | \2 |/'
96+
echo "\`\`\`"
97+
echo
98+
fi
99+
88100
echo "${delimiter}" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)