-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix formatting of
lambda
star arguments (#6257)
## Summary Previously, the ruff formatter was removing the star argument of `lambda` expressions when formatting. Given the following code snippet ```python lambda *a: () lambda **b: () ``` it would be formatted to ```python lambda: () lambda: () ``` We fix this by checking for the presence of `args`, `vararg` or `kwarg` in the `lambda` expression, before we were only checking for the presence of `args`. Fixes #5894 ## Test Plan Add new tests cases. --------- Co-authored-by: Charlie Marsh <[email protected]>
- Loading branch information
1 parent
c362ea7
commit 7c5791f
Showing
7 changed files
with
212 additions
and
242 deletions.
There are no files selected for viewing
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
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
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
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
234 changes: 0 additions & 234 deletions
234
...thon_formatter/tests/snapshots/black_compatibility@simple_cases__power_op_spacing.py.snap
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.