fix(tools): preserve backticks in overlap report paths #10916

Merged
Cankiee merged 1 commit from upstream-pr/10916 into main 2026-10-26 20:10:32 +00:00
Cankiee commented 2026-10-25 09:54:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Cankiee on 2026-10-25T09:54:16Z.


What

Fix Markdown code span formatting for file paths containing backticks in the PR overlap reports.

Previously, file paths were always wrapped in single backticks, causing malformed Markdown when a filename contained backtick characters.

This PR:

  • Adds a shared code_span() helper that chooses a delimiter longer than any backtick sequence in the filename.
  • Uses the helper in both cell() and spans().
  • Preserves existing formatting for ordinary filenames.
  • Adds five regression tests covering backtick-containing filenames, conflict links, and filename ordering.

Tested

Environment: Windows, Git Bash, Python.

  • python -m unittest discover -s tools/tests -p "test_pr_overlap.py" -v — 28 tests, OK (5 skipped due to platform-specific requirements).
  • python -m py_compile tools/pr_overlap.py tools/tests/test_pr_overlap.py — passed.
  • git diff --check — passed.
  • Manually verified filenames with one, two, leading, trailing, and mixed backticks.
  • Confirmed the original main implementation produces malformed Markdown for the reproduced example.

Checklist

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5003672933 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10916). Originally posted by [Cankiee](https://github.com/Cankiee) on 2026-10-25T09:54:16Z. --- ### What Fix Markdown code span formatting for file paths containing backticks in the PR overlap reports. Previously, file paths were always wrapped in single backticks, causing malformed Markdown when a filename contained backtick characters. This PR: - Adds a shared `code_span()` helper that chooses a delimiter longer than any backtick sequence in the filename. - Uses the helper in both `cell()` and `spans()`. - Preserves existing formatting for ordinary filenames. - Adds five regression tests covering backtick-containing filenames, conflict links, and filename ordering. ### Tested Environment: Windows, Git Bash, Python. - `python -m unittest discover -s tools/tests -p "test_pr_overlap.py" -v` — 28 tests, OK (5 skipped due to platform-specific requirements). - `python -m py_compile tools/pr_overlap.py tools/tests/test_pr_overlap.py` — passed. - `git diff --check` — passed. - Manually verified filenames with one, two, leading, trailing, and mixed backticks. - Confirmed the original `main` implementation produces malformed Markdown for the reproduced example. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [[technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md)](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [[technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt)](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file (not applicable) - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source (no third-party code added) - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-25 10:02:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T10:02:16Z.

Review: APPROVED


Reviewed exact head e75ee1d1e175d6b2d51171385ecab0d460d05236. The delimiter is longer than any backtick run in the path, ordinary names retain their existing Markdown, and the link path still percent-encodes backticks. I ran python3 -m py_compile tools/pr_overlap.py tools/tests/test_pr_overlap.py and the focused test file (python3 -m unittest discover -s tools/tests -p test_pr_overlap.py -v): all 28 tests pass, including the five new formatting cases. Hosted conventions, intake, relinker cross-platform, and ASan checks pass; product jobs are skipped by path policy.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5642643855 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10916#pullrequestreview-5642643855). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-25T10:02:16Z. **Review:** APPROVED --- Reviewed exact head `e75ee1d1e175d6b2d51171385ecab0d460d05236`. The delimiter is longer than any backtick run in the path, ordinary names retain their existing Markdown, and the link path still percent-encodes backticks. I ran `python3 -m py_compile tools/pr_overlap.py tools/tests/test_pr_overlap.py` and the focused test file (`python3 -m unittest discover -s tools/tests -p test_pr_overlap.py -v`): all 28 tests pass, including the five new formatting cases. Hosted conventions, intake, relinker cross-platform, and ASan checks pass; product jobs are skipped by path policy.
THEMANnt commented 2026-10-25 12:10:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-25T12:10:30Z.

Review: APPROVED


Reviewed head e75ee1d1e175d6b2d51171385ecab0d460d05236. No actionable findings in the backtick-preservation change.

Both table-cell and conflict-span rendering now choose a code-span delimiter longer than every backtick run in the path, with padding where needed. This preserves literal backticks without changing ordinary filename output, sorting or the URL-encoded conflict links. The added cases cover one and two embedded backticks and verify the encoded line link.

Validation: Windows/Python 3.11.9: tools/tests/test_pr_overlap.py -v runs 28 tests, 23 passed and 5 skipped; baseline has 18 passed and 5 skipped. New tests against baseline production fail exactly four formatting assertions. Conventions, whitespace and script registration pass. Hosted relinker matrix, ASan and policy checks pass; product jobs are skipped.

Scope: Report generation and Git fixtures. The five local skips concern POSIX filenames/shell fixtures; no live bot comment synchronization or application execution was performed.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5643146043 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10916#pullrequestreview-5643146043). Originally posted by [THEMANnt](https://github.com/THEMANnt) on 2026-10-25T12:10:30Z. **Review:** APPROVED --- Reviewed head `e75ee1d1e175d6b2d51171385ecab0d460d05236`. No actionable findings in the backtick-preservation change. Both table-cell and conflict-span rendering now choose a code-span delimiter longer than every backtick run in the path, with padding where needed. This preserves literal backticks without changing ordinary filename output, sorting or the URL-encoded conflict links. The added cases cover one and two embedded backticks and verify the encoded line link. **Validation:** Windows/Python 3.11.9: `tools/tests/test_pr_overlap.py -v` runs 28 tests, 23 passed and 5 skipped; baseline has 18 passed and 5 skipped. New tests against baseline production fail exactly four formatting assertions. Conventions, whitespace and script registration pass. Hosted relinker matrix, ASan and policy checks pass; product jobs are skipped. **Scope:** Report generation and Git fixtures. The five local skips concern POSIX filenames/shell fixtures; no live bot comment synchronization or application execution was performed.
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
boykopovar/AnyPS5!10916
No description provided.