fix(checker): only a RUNNABLE fence earns the doctest exemption

Fourth silent success in the same file, and the largest.

rustdoc does not execute ```text, ```ignore or ```no_run. The exemption
treated every fence alike, so prose wearing a fence was exempt from the cap --
and 74 lines of CLI documentation in gp-tree were sitting in exactly that hole.

Measured before narrowing it: `cargo test --doc` across the whole workspace was
0 passed / 2 ignored. NOT ONE of the six fences ran. So the exemption written to
protect doctests was protecting nothing, while shielding the longest comment
blocks in the tree from the rule it was written to enforce.

Both ignore blocks had also drifted out of agreement with the code, which is
precisely what ignore cannot catch: one called fit::fit with the parallel x/y
signature improvise-dkqn removed, against a Dataset with no rows field; the
other called a rank() that has never existed. CC-gp promoted both to running
doctests, so the workspace now has 2 that actually run.

Fault-injected: a ```text block with two prose lines either side is now
reported as a run of four, while a bare ``` block is still exempt.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Edward Langley
2026-09-20 10:16:59 -07:00
parent 122288d442
commit 8c13b1669d
+11 -2
View File
@@ -35,8 +35,17 @@ def comment_runs(lines):
s = raw.strip()
is_comment = s.startswith("//")
if is_comment and s.lstrip("/!").strip().startswith("```"):
in_fence = not in_fence
continue
info = s.lstrip("/!").strip()[3:].strip().lower()
# Only a RUNNABLE fence earns the exemption. rustdoc does not
# execute `text`, `ignore` or `no_run`, so those are prose wearing
# a fence -- and the exemption was covering 74 lines of CLI
# documentation on that basis. Measured before this rule landed:
# `cargo test --doc` was 0 passed / 2 ignored across the whole
# workspace, i.e. the exemption protected nothing that ran.
runnable = info in ("", "rust") or info.startswith("rust,")
if in_fence or runnable:
in_fence = not in_fence
continue
if is_comment and in_fence:
continue
if is_comment: