[`pyflakes`] Add secondary annotation showing previous definition (`F811`) by ntBre · Pull Request #19900 · astral-sh/ruff
added 4 commits
August 13, 2025 11:50
ntBre
marked this pull request as ready for review
ntBre
changed the title
Add sub-diagnostic to F811
[pyflakes] Add sub-diagnostic (F811)
ntBre
changed the title
[
[pyflakes] Add sub-diagnostic (F811)pyflakes] Add secondary annotation showing previous definition (F811)
ntBre added a commit that referenced this pull request
Aug 14, 2025Summary -- This is a quick implementation of the idea in #19900 (comment). Especially as we start using new diagnostic features, it seems like a good idea to keep an eye on the `concise` output format as well as the `full`. This PR just appends a second rendering of the diagnostics in our rule snapshots in the `concise` format. The concise message is typically reused in the other output formats too, so this gives us a bit of coverage for all the output formats. I noticed that some of our concise messages are still quite long. That might be another good class of diagnostic to use new features for. Some explanatory pieces might fit better as sub-diagnostics. Test Plan -- Existing snapshots. Again, I clicked through these individually, but very, very quickly
ntBre
mentioned this pull request
ntBre added a commit that referenced this pull request
Aug 14, 2025Summary -- This is a quick implementation of the idea in #19900 (comment). Especially as we start using new diagnostic features, it seems like a good idea to keep an eye on the `concise` output format as well as the `full`. This PR just appends a second rendering of the diagnostics in our rule snapshots in the `concise` format. The concise message is typically reused in the other output formats too, so this gives us a bit of coverage for all the output formats. I noticed that some of our concise messages are still quite long. That might be another good class of diagnostic to use new features for. Some explanatory pieces might fit better as sub-diagnostics. Test Plan -- Existing snapshots. Again, I clicked through these individually, but very, very quickly
ntBre
deleted the
brent/redefined-while-unused
branch
dcreager added a commit that referenced this pull request
Aug 14, 2025* main: [ty] Add diagnostics for invalid `await` expressions (#19711) [ty] Synthesize read-only properties for all declared members on `NamedTuple` classes (#19899) [ty] Remove use of `ClassBase::try_from_type` from `super()` machinery (#19902) [ty] Speedup project file discovery (#19913) [`pyflakes`] Add secondary annotation showing previous definition (`F811`) (#19900) Bump 0.12.9 (#19917) [ty] support `kw_only=True` for `dataclass()` and `field()` (#19677)
ntBre
mentioned this pull request
7 tasks
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