Commit 347aa1d
committed
fix: report tech-debt changes by data-row content, not line count
Previously `prSummaryReport` decided whether to render a report by
counting lines in the rendered text:
if [ "$(wc -l <<<"${rep}")" -le 5 ]; then "no changes"
That worked in the original layout (mathlib4#18971) where `report`
emitted 5 boilerplate lines (header + separator + blank + 2 commit
URLs). When the strong/weak split (#28) moved the commit URLs into a
separate `reportFooter`, only 2 boilerplate lines remained in `rep`,
but the `-le 5` threshold was kept. Any PR changing three or fewer
counters of a given level was silently reported as "no changes" — e.g.
leanprover-community/mathlib4#39932 removed
one `set_option backward.isDefEq.respectTransparency false in` without
the bot noticing.
Instead of patching the threshold (which would stay coupled to whatever
incidental formatting `report` happens to emit), filter directly to the
non-zero data rows in a named `filterChangedRows`, branch on
`[ -z "${changedRows}" ]`, and reconstruct the table header in the
"has changes" branch. The Change column is used as the test (rather
than the Current column) because a counter that disappeared entirely
in the new commit renders as `||-1|name|` — empty Current — and we
still want to report it.
🤖 Prepared with Claude Code1 parent aafe3df commit 347aa1d
1 file changed
Lines changed: 33 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
190 | 204 | | |
191 | 205 | | |
192 | | - | |
| 206 | + | |
193 | 207 | | |
194 | | - | |
| 208 | + | |
195 | 209 | | |
196 | 210 | | |
197 | 211 | | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | 212 | | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
211 | 228 | | |
212 | 229 | | |
213 | 230 | | |
| |||
221 | 238 | | |
222 | 239 | | |
223 | 240 | | |
224 | | - | |
225 | | - | |
| 241 | + | |
| 242 | + | |
226 | 243 | | |
227 | 244 | | |
228 | 245 | | |
| |||
0 commit comments