[pyupgrade] Split UP007 to two individual rules for Union and Optional (UP007, UP045)#15313
Merged
MichaReiser merged 7 commits intoastral-sh:mainfrom Jan 7, 2025
Merged
[pyupgrade] Split UP007 to two individual rules for Union and Optional (UP007, UP045)#15313MichaReiser merged 7 commits intoastral-sh:mainfrom
pyupgrade] Split UP007 to two individual rules for Union and Optional (UP007, UP045)#15313MichaReiser merged 7 commits intoastral-sh:mainfrom
Conversation
…Optional` (`UP007`, `UP045`)
Contributor
|
| 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 |
Member
|
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 |
MichaReiser
reviewed
Jan 7, 2025
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
Contributor
Author
Some of the projects have |
Member
|
Ah, that makes sense. |
Contributor
Author
|
@MichaReiser I think #11379 can be closed now. |
3 tasks
dcreager
added a commit
that referenced
this pull request
Jan 7, 2025
* 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)
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves #4858. Part of this PR was taken from #11379.
Test Plan
cargo nextest runandcargo insta test.