-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use optional parentheses for tuples in return statement
- Loading branch information
1 parent
f2eb7bc
commit 093e06a
Showing
6 changed files
with
139 additions
and
33 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
crates/ruff_python_formatter/resources/test/fixtures/ruff/statement/return.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
return len(self.nodeseeeeeeeee), sum( | ||
len(node.parents) for node in self.node_map.values() | ||
) | ||
|
||
|
||
return len(self.nodeseeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee), sum( | ||
len(node.parents) for node in self.node_map.values() | ||
) | ||
|
||
|
||
return ( | ||
len(self.nodeseeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee), sum( | ||
len(node.parents) for node in self.node_map.values() | ||
) | ||
) |
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
44 changes: 44 additions & 0 deletions
44
crates/ruff_python_formatter/tests/snapshots/format@statement__return.py.snap
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
source: crates/ruff_python_formatter/tests/fixtures.rs | ||
input_file: crates/ruff_python_formatter/resources/test/fixtures/ruff/statement/return.py | ||
--- | ||
## Input | ||
```py | ||
return len(self.nodeseeeeeeeee), sum( | ||
len(node.parents) for node in self.node_map.values() | ||
) | ||
return len(self.nodeseeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee), sum( | ||
len(node.parents) for node in self.node_map.values() | ||
) | ||
return ( | ||
len(self.nodeseeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee), sum( | ||
len(node.parents) for node in self.node_map.values() | ||
) | ||
) | ||
``` | ||
|
||
## Output | ||
```py | ||
return len(self.nodeseeeeeeeee), sum( | ||
len(node.parents) for node in self.node_map.values() | ||
) | ||
return len( | ||
self.nodeseeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee | ||
), sum(len(node.parents) for node in self.node_map.values()) | ||
return ( | ||
len(self.nodeseeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee), | ||
sum(len(node.parents) for node in self.node_map.values()), | ||
) | ||
``` | ||
|
||
|
||
|