Skip to content

Add TOML support to mdtest - #26802

Merged
ntBre merged 1 commit into
mainfrom
brent/toml-mdtest
Jul 14, 2026
Merged

Add TOML support to mdtest#26802
ntBre merged 1 commit into
mainfrom
brent/toml-mdtest

Conversation

@ntBre

@ntBre ntBre commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

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. Because we already use toml blocks 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,

```toml
lint.select = ["F401"]
```

remains a configuration block, but

`ruff.toml`:

```toml
lint.select = ["F401"]
```

will be linted.

Test Plan

Added one test for RUF200 and unit tests for the parsing itself.

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
@ntBre ntBre added the testing Related to testing Ruff itself label Jul 14, 2026
@astral-sh-bot

astral-sh-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

Typing conformance results

No changes detected ✅

Current numbers
The 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.

@astral-sh-bot

astral-sh-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

Memory usage report

Memory usage unchanged ✅

@astral-sh-bot

astral-sh-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

ecosystem-analyzer results

No diagnostic changes detected ✅

Full report with detailed diff (timing results)

@astral-sh-bot

astral-sh-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

@ntBre
ntBre marked this pull request as ready for review July 14, 2026 15:18
@ntBre
ntBre requested a review from a team as a code owner July 14, 2026 15:18
@ntBre
ntBre requested a review from MichaReiser July 14, 2026 15:18

@MichaReiser MichaReiser left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I didn't realize that this would require special casing for comments. But it doesn't seem to be to big a change

@ntBre
ntBre merged commit 53b0733 into main Jul 14, 2026
63 checks passed
@ntBre
ntBre deleted the brent/toml-mdtest branch July 14, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Related to testing Ruff itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants