Format lambda expression#5806
Merged
MichaReiser merged 14 commits intoastral-sh:mainfrom Jul 19, 2023
Merged
Conversation
Contributor
PR Check ResultsEcosystem✅ ecosystem check detected no changes. BenchmarkLinuxWindows |
Closed
MichaReiser
approved these changes
Jul 18, 2023
crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/lambda.py
Show resolved
Hide resolved
Contributor
Author
|
See comment. In the meantime I'll mark this as ready since the debug assert is a good safeguard IIUC. |
To without parentheses
MichaReiser
approved these changes
Jul 19, 2023
Member
MichaReiser
left a comment
There was a problem hiding this comment.
Looks good to me. Let's override fmt_dangling_comments and we're then good to merge
Contributor
Author
|
Dang! So close |
cnpryer
commented
Jul 19, 2023
Co-authored-by: Chris Pryer <14341145+cnpryer@users.noreply.github.com>
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
See #5810.
Implements
ArgumentsParentheses::SkipInsideLambdaforFormatArgumentsto unblocklambdaformatting.Test Plan
Existing snapshots and potentially more fixtures.
0.978 -> 0.98 on django similarity index
I wasn't sure if I wanted to claim this one because I was violating the orphan rule workaround by modifying the generated.rs. I noticed (1) if I regenerated them it'd modify the currently checked in generated.rs, so I figured there may have been some manual adjustments already. (2) I saw #5804 modify it manually in the same way. I looked at some of #4951 as well.
TODO:
ForamtArgumentsDefault