tests/docs: read an indented code block as code, not prose (OLD-9836) #1781

Merged
Ch1mpleo merged 1 commit from upstream-pr/1781 into main 2026-11-25 21:24:53 +00:00
Ch1mpleo commented 2026-11-25 12:02:19 +00:00 (Migrated from github.com)

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

  • python -I tests/test_docs_repeated_lines.py — 3 tests, OK (Windows 11 x64, Python 3.14.7, CPU-only, no game files).
  • python -I scripts/check_no_game_data.py tests/test_docs_repeated_lines.py — exit 0.
  • python -m compileall -q tests/test_docs_repeated_lines.py — exit 0.

GPUs tested: n/a (CPU-only standard-library unit test)

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled
    eeds rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a — unit test fix only)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5490935241 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1781). Originally posted by [Ch1mpleo](https://github.com/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 - python -I tests/test_docs_repeated_lines.py — 3 tests, OK (Windows 11 x64, Python 3.14.7, CPU-only, no game files). - python -I scripts/check_no_game_data.py tests/test_docs_repeated_lines.py — exit 0. - python -m compileall -q tests/test_docs_repeated_lines.py — exit 0. GPUs tested: n/a (CPU-only standard-library unit test) AI-assisted: yes ### Checklist - [x] Based on current main and merges cleanly (a conflicting pull request is labeled eeds rebase). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a — unit test fix only)
PierreEbele commented 2026-11-25 19:00:45 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T19:00:45Z.


Reviewed 41639e899: ran python -I tests/test_docs_repeated_lines.py on 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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7171701414 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1781#issuecomment-7171701414). Originally posted by [PierreEbele](https://github.com/PierreEbele) on 2026-11-25T19:00:45Z. --- Reviewed 41639e899: ran `python -I tests/test_docs_repeated_lines.py` on 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
MSedgeMC commented 2026-11-25 19:03:22 +00:00 (Migrated from github.com)

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.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6063357268 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1781#pullrequestreview-6063357268). Originally posted by [MSedgeMC](https://github.com/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.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!1781
No description provided.