-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Clean up unused rendering code in ruff_linter
#19832
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
ruff_linter
Diagnostic diff on typing conformance testsNo changes detected when running ty on typing conformance tests ✅ |
|
MichaReiser
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
* main: (31 commits) Add AIR301 rule (#17707) Avoid underflow in default ranges before a BOM (#19839) Update actions/download-artifact digest to de96f46 (#19852) Update docker/login-action action to v3.5.0 (#19860) Update rui314/setup-mold digest to 7344740 (#19853) Update cargo-bins/cargo-binstall action to v1.14.4 (#19855) Update actions/cache action to v4.2.4 (#19854) Update Rust crate hashbrown to v0.15.5 (#19858) Update Rust crate camino to v1.1.11 (#19857) Update Rust crate proc-macro2 to v1.0.96 (#19859) Update dependency ruff to v0.12.8 (#19856) SIM905: Fix handling of U+001C..U+001F whitespace (#19849) RUF064: offer a safe fix for multi-digit zeros (#19847) Clean up unused rendering code in `ruff_linter` (#19832) [ty] Add Salsa caching to `TupleType::to_class_type` (#19840) [ty] Handle cycles when finding implicit attributes (#19833) [ty] fix goto-definition on imports (#19834) [ty] Implement stdlib stub mapping (#19529) [`flake8-comprehensions`] Fix false positive for `C420` with attribute, subscript, or slice assignment targets (#19513) [ty] Implement module-level `__getattr__` support (#19791) ...
Summary
This is a follow-up to #19415 (comment) to remove some unused code. As Micha noticed,
GroupedEmitter::with_show_sourcewas only used in local unit tests1 and was safe to remove. This allowed deletingMessageCodeFrameand a lot more helper code previously shared with thefulloutput format.I also moved some other code from
text.rsandmessage/mod.rsintogrouped.rsthat is now only used for thegroupedformat. With a little refactoring of theconciserendering logic inruff_db, we could probably removeRuleCodeAndBodytoo. The only difference I see from theconciseoutput is whether we print the filename next to the row and column or not:But I didn't try to do that here.
Test Plan
Existing tests, with the source code no longer displayed. I also deleted one test, as it was now a duplicate of the
defaulttest.Footnotes
"Local unit tests" as opposed to all of our linter snapshot tests, as is the case for
TextEmitter::with_show_fix_diff. We also want to expose that to users eventually (https://github.com/astral-sh/ruff/issues/7352), which I don't believe is the case for thegroupedformat. ↩