Draft
Conversation
Typing conformance resultsNo changes detected ✅Current numbersThe percentage of diagnostics emitted that were expected errors held steady at 87.94%. The percentage of expected errors that received a diagnostic held steady at 83.21%. The number of fully passing files held steady at 79/133. |
Memory usage reportMemory usage unchanged ✅ |
|
|
ntBre
commented
Apr 13, 2026
| use anyhow::anyhow; | ||
| use camino::Utf8Path; | ||
| use ruff_test::OutputFormat; | ||
| use ty_static::EnvVars; |
Contributor
Author
There was a problem hiding this comment.
I saw https://github.com/astral-sh/ruff/pull/24557/changes#r3069608578 about not using this even in ty_test, which I think makes even more sense here.
MichaReiser
reviewed
Apr 14, 2026
Comment on lines
+23
to
+28
| let output_format = if std::env::var(EnvVars::MDTEST_GITHUB_ANNOTATIONS_FORMAT).is_ok() { | ||
| OutputFormat::GitHub | ||
| } else { | ||
| OutputFormat::Cli | ||
| }; | ||
|
|
Member
There was a problem hiding this comment.
We could also consider moving this into ty_test::run? Seems weird that this needs to be reated at every call site.
7b52254 to
39890d5
Compare
Summary -- This PR adds the `ruff_test` crate, a parallel crate to `ty_test` for Ruff, to enable the new mdtests in `ruff_linter`. I opted to follow the `Db`-based structure of `ty_test` to simplify the integration, but we end up basically just unpacking the files from the `Db` to call the `test_contents` function from the linter. Currently stacked on #24616 Test Plan -- I copied over UP046_0.py into a new mdtest. This was selected basically at random, and I should probably either pick a shorter first test to port, or also port over the other UP046 tests and take better advantage of the mdtest format. Currently the whole file is just in a single code block, but it demonstrates the basic functionality, including config loading and diagnostic snapshotting.
39890d5 to
7f6a3ca
Compare
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 adds the
ruff_testcrate, a parallel crate toty_testfor Ruff, toenable the new mdtests in
ruff_linter. I opted to follow theDb-basedstructure of
ty_testto simplify the integration, but we end up basically justunpacking the files from the
Dbto call thetest_contentsfunction from thelinter.
Currently stacked on #24616
Test Plan
I copied over UP046_0.py into a new mdtest. This was selected basically at
random, and I should probably either pick a shorter first test to port, or also
port over the other UP046 tests and take better advantage of the mdtest format.
Currently the whole file is just in a single code block, but it demonstrates the
basic functionality, including config loading and diagnostic snapshotting.