Repository navigation
Python: Honor literal Markdown paths in --no-glob mode - #9691
Closed
LI (ktz03) wants to merge 1 commit into
Closed
LI (ktz03) wants to merge 1 commit into
LI (ktz03) wants to merge 1 commit into
Conversation
LI (ktz03)
requested review from
SergeyMenshykh,
Tao Chen (TaoChenOSU),
Vincent Biret (baywet),
Eduard van Valkenburg (eavanvalkenburg),
Giles Odigwe (giles17),
Jose Alvarez (jpalvarezl),
Evan Mattson (moonbox3),
Peter Ibekwe (peibekwe),
Roger Barreto (rogerbarreto),
sophia-ramsey and
westey (westey-m)
as code owners
October 26, 2026 02:03
LI (ktz03)
temporarily deployed
to
github-app-auth
October 26, 2026 02:03 — with
GitHub Actions
Inactive
LI (ktz03)
temporarily deployed
to
github-app-auth
October 26, 2026 02:03 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The fix is narrowly scoped, the regression tests cover the reported failure and preserved behavior, and no blocking issues were identified.
No open issues 🎉
What changed in this PR
This PR restores the Markdown checker’s literal-path behavior for --no-glob, including paths containing brackets, without changing normal glob expansion.
Changes:
- Escape glob metacharacters in the literal-path branch.
- Add eight regression tests covering literal selection, existing filtering and glob behavior, and the real CLI.
- Run the tests in the existing Samples & Markdown CI job using the
tool-markdowndependency group.
| File | Description |
|---|---|
python/scripts/tests/test_check_md_code_blocks.py |
Adds eight file-selection and CLI regression tests. |
python/scripts/check_md_code_blocks.py |
Escapes literal paths before passing them to glob.glob. |
.github/workflows/python-code-quality.yml |
Adds the regression tests to the existing CI job. |
Review effort: Balanced
4 of 7 tasks
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation & Context
The Markdown checker promises literal file paths with
--no-glob, and the changed-file hook uses that option. It still passes those paths directly toglob.glob. A valid file namedguide[1].mdis silently skipped, orguide1.mdis checked instead when both exist. Brackets in a parent directory have the same effect.Description & Review Guide
tool-markdowndependency group.Related Issue
N/A - trivial change. This restores the existing option's explicit "literal paths (no glob expansion)" contract without changing the ordinary glob mode or introducing new behavior to configure.
AI Assistance
AI assistance details: Codex: implementation, regression tests, and this PR description.
Contribution Checklist