-
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
Format lambda
expression
#5806
Merged
Merged
Format lambda
expression
#5806
Conversation
This file contains 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
PR Check ResultsEcosystem✅ ecosystem check detected no changes. BenchmarkLinux
Windows
|
Closed
MichaReiser
approved these changes
Jul 18, 2023
crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/lambda.py
Show resolved
Hide resolved
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
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.
Looks good to me. Let's override fmt_dangling_comments
and we're then good to merge
Dang! So close |
cnpryer
commented
Jul 19, 2023
Co-authored-by: Chris Pryer <14341145+cnpryer@users.noreply.github.com>
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::SkipInsideLambda
forFormatArguments
to unblocklambda
formatting.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:
ForamtArguments
Default