You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
anishgirianish
changed the title
[ruff] Add fix for none-not-at-end-of-union (RUF036)
[ruff] Add fix for none-not-at-end-of-union (RUF036)
Jan 24, 2026
Thanks @anishgirianish for working on this! I haven't looked at the diff yet, so apologies if you've addressed all of these, but I was hoping you could check whether or not you had resolved my comment on a previous version of this PR? See #18964 (review) and the comments it links to on an even earlier version. I think that's a good summary of the missing pieces from the earlier iterations and would help me get started reviewing this PR.
Thanks @anishgirianish for working on this! I haven't looked at the diff yet, so apologies if you've addressed all of these, but I was hoping you could check whether or not you had resolved my comment on a previous version of this PR? See #18964 (review) and the comments it links to on an even earlier version. I think that's a good summary of the missing pieces from the earlier iterations and would help me get started reviewing this PR.
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
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
Adds an autofix for
RUF036that movesNoneto the end of union type annotations.Closes #15136
The fix:
|vstyping.Union)Nonevalues instead of deduplicatingNone | Union[int, str])Test Plan
cargo nextest run -p ruff_linter- added test cases for nested unions, comments,default arguments, and mixed styles.