fix(colab): Add linter for malformed lists in generated notebooks - #3947
Draft
ribhuji wants to merge 1 commit into
Draft
fix(colab): Add linter for malformed lists in generated notebooks#3947ribhuji wants to merge 1 commit into
ribhuji wants to merge 1 commit into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/tutorials/3947
Note: Links to docs will display an error until the docs builds have been completed. This comment was automatically generated by Dr. CI and updates every 15 minutes. |
ribhuji
marked this pull request as draft
August 3, 2026 10:22
Contributor
Author
|
@albanD, could you please approve the workflow run for this draft PR? The current commit intentionally contains only the new Lintrunner check. The job is expected to fail with 14 diagnostics across the 10 tutorials documented in #3946, which will validate that the check detects the existing issues. Once that run is recorded, I’ll push a second commit fixing those violations. This will preserve both the detection run and the final passing run in the PR history. Thank you! |
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.
Fixes #3946
Description
Some list structures in Sphinx-Gallery tutorial sources render correctly in the HTML documentation but become malformed after conversion to Markdown in the generated Google Colab notebooks.
This PR adds a repository-local
TUTORIAL_MARKUPLintrunner check that detects the two source patterns responsible for the problems documented in #3946:The checker only examines Sphinx-Gallery narrative content from module docstrings and gallery comment blocks. It accounts for valid nested lists, reStructuredText directives, and list tables to avoid reporting those as violations.
Validation strategy
This draft is being built in two commits so the Lintrunner behavior can be verified directly in GitHub Actions:
The expected CI result is 14 diagnostics across exactly the 10 tutorials documented in [BUG] - Incorrect list rendering in Google Colab tutorials #3946, with no additional tutorial files reported.
The subsequent CI run should pass with no
TUTORIAL_MARKUPdiagnostics.Local validation
python3 -m unittest discover -s tools/linter/tests -p 'test_*.py' lintrunner --all-files --take TUTORIAL_MARKUPThe unit test suite currently passes all eight tests. The complete linter scan reports 14 diagnostics across the 10 affected tutorial files and reports no other tutorial files.
Checklist