[ty] Filter out revealed-type and undefined-reveal diagnostics from mdtest snapshots#20820
Conversation
…om mdtest snapshots
Diagnostic diff on typing conformance testsNo changes detected when running ty on typing conformance tests ✅ |
|
|
I think I'd prefer if we disable the rule instead of filtering out the diagnostics here: Line 29 in dc64c08 We could then (in the future, not in this PR), add a |
That would disable these rules for mdtest as a whole, rather than just the snapshots, though, right? There's a fair amount of logic in mdtest that's specifically there so that we don't have to do that. I suggested just suppressing these rules instead in mdtest just over a year ago, but @carljm was against it, which is why the approach I'm taking here attempts to specifically filter the diagnostics out of mdtest snapshots without disabling these diagnostics for regular mdtest. |
c9ede83 to
07b5c29
Compare
Summary
As we discussed in ty planning on Friday,
revealed-typeandundefined-revealdiagnostics often make mdtest snapshots very noisy. They're almost never relevant to the reason why you've enabled snapshotting for a specific mdtest. Theundefined-revealdiagnostics can be avoided by explicitly importingreveal_type(which is not something you'd usually do in an mdtest), but therevealed-typediagnostics can only be avoided by having a separate mdtest entirely that enables snapshotting and avoids having anyreveal_typecalls in it.This PR suppresses
revealed-typeandundefined-revealdiagnostics from the diagnostics snapshotted during an mdtest run. If we do want to capture a snapshot that shows how these diagnostics are displayed, we can still do that as an end-to-end CLI test in thetycrate.Test Plan
Snapshots!