tests/docs: read an indented code block as code, not prose (OLD-9836) #1781
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1781"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by Ch1mpleo on 2026-11-25T12:02:19Z.
Claimed in the coordination issue as: OLD-9836 (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7161825065)
What and why
Carries forward old-pr/9836 (draft #104, keeping
oosko21-a11y's original commit rebased onto current main). Fixes ests/test_docs_repeated_lines.py::repeated_lines to treat 4-space and tab-indented Markdown code blocks as code rather than prose, and adds est_checker_ignores_indented_code_blocks.
Tested
GPUs tested: n/a (CPU-only standard-library unit test)
AI-assisted: yes
Checklist
eeds rebase).
Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T19:00:45Z.
Reviewed
41639e899: ranpython -I tests/test_docs_repeated_lines.pyon main (Ran 2 tests, OK) and on the PR (Ran 3 tests, OK), and a probe comparing the old and new checker over all tracked .md files (both report zero today). The motivating failure is already historical: #10002 fenced that README block on 24 Nov, before this PR's base, so main is green and no indented code block remains in the docs. The new rule also skips 4-space list continuations, which CommonMark reads as prose, not code (reproduced: old reports (2,4), new skips it); no live duplicate is hidden today. The new test pins the fix (it fails under main's checker). Sound as written; the direction (checker vs fenced doc) and the list-continuation exemption need the maintainer's call.AI-assisted review.
Recommendation: Needs discussion
Imported from ubiquitarianism/leonida. Originally posted by MSedgeMC on 2026-11-25T19:03:22Z.
Review: APPROVED
Verified on the PR branch (clean, 1 commit ahead of main): python3 -m unittest tests.test_docs_repeated_lines -v -> 3 tests OK, including the new indented/tabbed code-block case and the full docs corpus check. The fix correctly treats Markdown indented code blocks like fenced ones in the repeated-lines docs test, removing false positives while keeping the prose check intact. Python-only, no game data.