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

Merged
leonida/mandy
Ch1mpleo merged 1 commit from carry/old-9836 into main 2026-11-25 21:24:53 +00:00

Pull request successfully merged and closed

Ch1mpleo commented 2026-11-25 12:02:19 +00:00

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)
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

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

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 approved these changes 2026-11-25 19:03:22 +00:00
MSedgeMC left a comment

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.

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 description provided.