ruff/crates/red_knot
Andrew Gallant 28b64064f5 ruff_db: tweak how the revealed type diagnostic is rendered
In the new diagnostic data model, we really should have a main
diagnostic message *and* a primary span (with an optional message
attached to it) for every diagnostic.

In this commit, I try to make this true for the "revealed type"
diagnostic. Instead of the annotation saying both "revealed type is"
and also the revealed type itself, the annotation is now just the
revealed type and the main diagnostic message is "Revealed type."

I expect this may be controversial. I'm open to doing something
different. I tried to avoid redundancy, but maybe this is a special case
where we want the redundancy. I'm honestly not sure. I do *like* how it
looks with this commit, but I'm not working with Red Knot's type
checking daily, so my opinion doesn't count for much.

This did also require some tweaking to concise diagnostic formatting in
order to preserve the essential information.

This commit doesn't update every relevant snapshot. Just a few. I split
the rest out into the next commit.
2025-04-10 13:21:00 -04:00
..
docs [red-knot] Add mypy_primer usage documentation (#16679) 2025-03-12 16:47:10 +01:00
src [red-knot] Default python-platform to current platform (#17183) 2025-04-09 12:05:18 +02:00
tests ruff_db: tweak how the revealed type diagnostic is rendered 2025-04-10 13:21:00 -04:00
build.rs [red-knot] Add version command (#15823) 2025-02-02 18:56:51 +00:00
Cargo.toml [red-knot] Add argfile and windows glob path support (#16353) 2025-02-25 08:43:13 +01:00
README.md Add red_knot/README.md (#16230) 2025-02-18 23:31:02 -08:00

Red Knot

Red Knot is an extremely fast type checker. Currently, it is a work-in-progress and not ready for user testing.

Red Knot is designed to prioritize good type inference, even in unannotated code, and aims to avoid false positives.

While Red Knot will produce similar results to mypy and pyright on many codebases, 100% compatibility with these tools is a non-goal. On some codebases, Red Knot's design decisions lead to different outcomes than you would get from running one of these more established tools.

Contributing

Core type checking tests are written as Markdown code blocks. They can be found in red_knot_python_semantic/resources/mdtest. See red_knot_test/README.md for more information on the test framework itself.

The list of open issues can be found here.