-
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
[pyupgrade
] Split UP007
to two individual rules for Union
and Optional
(UP007
, UP045
)
#15313
Conversation
…Optional` (`UP007`, `UP045`)
|
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
UP045 | 1552 | 1552 | 0 | 0 | 0 |
UP007 | 92 | 0 | 92 | 0 | 0 |
PLR6301 | 2 | 1 | 1 | 0 | 0 |
D100 | 2 | 1 | 1 | 0 | 0 |
RUF100 | 2 | 2 | 0 | 0 | 0 |
It's unclear to me why the ecosystem changes show more new UP045 violations than removed UP007 violations. Do we need to rebase this on main to get the |
crates/ruff_linter/src/rules/pyupgrade/rules/use_pep604_annotation.rs
Outdated
Show resolved
Hide resolved
crates/ruff_linter/src/rules/pyupgrade/rules/use_pep604_annotation.rs
Outdated
Show resolved
Hide resolved
Some of the projects have |
Ah, that makes sense. |
@MichaReiser I think #11379 can be closed now. |
* main: Use uv consistently throughout the documentation (#15302) [red-knot] Eagerly normalize `type[]` types (#15272) [`pyupgrade`] Split `UP007` to two individual rules for `Union` and `Optional` (`UP007`, `UP045`) (#15313) [red-knot] Improve symbol-lookup tracing (#14907) [red-knot] improve type shrinking coverage in red-knot property tests (#15297) [`flake8-return`] Recognize functions returning `Never` as non-returning (`RET503`) (#15298) [`flake8-bugbear`] Implement `class-as-data-structure` (`B903`) (#9601) Avoid treating newline-separated sections as sub-sections (#15311) Remove call when removing final argument from `format` (#15309) Don't enforce `object-without-hash-method` in stubs (#15310) Don't special-case class instances in binary expression inference (#15161) Upgrade zizmor to the latest version in CI (#15300)
Summary
Resolves #4858. Part of this PR was taken from #11379.
Test Plan
cargo nextest run
andcargo insta test
.