Repository navigation
Commit 6bce242
committed
feat(show): validate title count up front
Builds on the per-panel title fix (#695): before the panel loop, validate
that `title`, when a list, has length 1 or exactly num_panels. This:
- surfaces the error before any drawing (not mid-render),
- rejects an over-long title list (previously silently truncated), and
- makes the per-panel IndexError dead code, so the try/except is removed.
The error is now a ValueError (the right type for an invalid argument)
raised once up front, instead of an IndexError raised per panel mid-render.
No test pinned the old exception type. Adds non-visual regression tests
for single- and multi-panel title-count validation.
Pre-existing mypy error in utils.py (_resolve_measure_table returning Any)
is unrelated and unchanged here; it is fixed separately in #714.1 parent 6557e30 commit 6bce242
2 files changed
Lines changed: 32 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1519 | 1519 | | |
1520 | 1520 | | |
1521 | 1521 | | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
1522 | 1530 | | |
1523 | 1531 | | |
1524 | 1532 | | |
| |||
1794 | 1802 | | |
1795 | 1803 | | |
1796 | 1804 | | |
1797 | | - | |
1798 | | - | |
| 1805 | + | |
1799 | 1806 | | |
1800 | 1807 | | |
1801 | 1808 | | |
1802 | 1809 | | |
1803 | 1810 | | |
1804 | | - | |
1805 | | - | |
1806 | | - | |
1807 | | - | |
| 1811 | + | |
| 1812 | + | |
1808 | 1813 | | |
1809 | 1814 | | |
1810 | 1815 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
139 | 160 | | |
140 | 161 | | |
141 | 162 | | |
| |||
0 commit comments