-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Don't remove comments along with parens (#4218)
Signed-off-by: RedGuy12 <61329810+RedGuy12@users.noreply.github.com>
- Loading branch information
Showing
3 changed files
with
122 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
if ( | ||
True | ||
# sdf | ||
): | ||
print("hw") | ||
|
||
if (( | ||
True | ||
# sdf | ||
)): | ||
print("hw") | ||
|
||
if (( | ||
# type: ignore | ||
True | ||
)): | ||
print("hw") | ||
|
||
if (( | ||
True | ||
# type: ignore | ||
)): | ||
print("hw") | ||
|
||
if ( | ||
# a long comment about | ||
# the condition below | ||
(a or b) | ||
): | ||
pass | ||
|
||
def return_true(): | ||
return ( | ||
( | ||
True # this comment gets removed accidentally | ||
) | ||
) | ||
|
||
def return_true(): | ||
return (True) # this comment gets removed accidentally | ||
|
||
|
||
if ( | ||
# huh comment | ||
(True) | ||
): | ||
... | ||
|
||
if ( | ||
# huh | ||
( | ||
# comment | ||
True | ||
) | ||
): | ||
... | ||
|
||
|
||
# output | ||
|
||
if ( | ||
True | ||
# sdf | ||
): | ||
print("hw") | ||
|
||
if ( | ||
True | ||
# sdf | ||
): | ||
print("hw") | ||
|
||
if ( | ||
# type: ignore | ||
True | ||
): | ||
print("hw") | ||
|
||
if ( | ||
True | ||
# type: ignore | ||
): | ||
print("hw") | ||
|
||
if ( | ||
# a long comment about | ||
# the condition below | ||
a | ||
or b | ||
): | ||
pass | ||
|
||
|
||
def return_true(): | ||
return True # this comment gets removed accidentally | ||
|
||
|
||
def return_true(): | ||
return True # this comment gets removed accidentally | ||
|
||
|
||
if ( | ||
# huh comment | ||
True | ||
): | ||
... | ||
|
||
if ( | ||
# huh | ||
# comment | ||
True | ||
): | ||
... |