Add TOML support to mdtest - #26802
Merged
Merged
Conversation
Summary -- This PR was split off from #26772 to add support for testing TOML lint rules to mdtest. We use the toml_parser crate to extract comments and now call `lint_pyproject_toml` in ruff_mdtest. Test Plan -- Added one test for RUF200 and a unit test for the parsing itself
Typing conformance resultsNo changes detected ✅Current numbersThe percentage of diagnostics emitted that were expected errors held steady at 94.61%. The percentage of expected errors that received a diagnostic held steady at 90.27%. The number of fully passing files held steady at 97/134. |
Memory usage reportMemory usage unchanged ✅ |
|
|
MichaReiser
approved these changes
Jul 14, 2026
MichaReiser
left a comment
Member
There was a problem hiding this comment.
Nice, I didn't realize that this would require special casing for comments. But it doesn't seem to be to big a change
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.
Summary
This PR was split off from #26772 to add support for testing TOML lint rules to mdtest. We use the
toml_parser crate to extract comments and now call
lint_pyproject_tomlin ruff_mdtest. Because we already usetomlblocks for test configuration and because Ruff's current TOML lints need to know the filename, I opted to require a filename for linted TOML blocks. For example,remains a configuration block, but
will be linted.
Test Plan
Added one test for RUF200 and unit tests for the parsing itself.