-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add autofix for PYI030
#7934
Add autofix for PYI030
#7934
Conversation
cd9ee25
to
0f7c782
Compare
0f7c782
to
ecaa860
Compare
PYI030
PR Check ResultsEcosystem✅ ecosystem check detected no changes. |
Could you gate this fix so it only applies when preview mode is enabled? |
I believe I've done this correctly, doesn't seem like any other fix is gated this way. 🤔 If I've done this wrong, please advise! |
crates/ruff_linter/src/rules/flake8_pyi/rules/unnecessary_literal_union.rs
Outdated
Show resolved
Hide resolved
crates/ruff_linter/src/rules/flake8_pyi/rules/unnecessary_literal_union.rs
Outdated
Show resolved
Hide resolved
crates/ruff_linter/src/rules/flake8_pyi/rules/unnecessary_literal_union.rs
Outdated
Show resolved
Hide resolved
Hey sorry this is on my todo list to review but I got distracted last week – I'll try to get to this on Monday! |
Take your time! |
…ral_union.rs Co-authored-by: Zanie Blue <contact@zanie.dev>
0b42ef0
to
4729836
Compare
|
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
PYI030 | 6 | 0 | 0 | 6 | 0 |
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.
This lgtm! Thanks for your patience.
CodSpeed Performance ReportMerging #7934 will improve performances by 12.27%Comparing Summary
Benchmarks breakdown
|
Summary
Part 2 of implementing the reverted autofix for
PYI030
Also handles
typing.Union
andtyping_extensions.Literal
etc, uses the first subscript name it finds for each offensive line.Test Plan
cargo test
and manually