You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classClass:
defcan_do_thing(self, thing) ->bool:
ifself.thing_id==thing.id:
returnTrueifself.x:
ifself.y.z(thing):
returnTrueelse:
# This comment should not be eaten by automated fixes,# because it explains important context about the next if block.# I would be quite sad if it vanished, because I'm quite fond of it.ifself.thing.color==thing.color_id:
returnTruereturnFalse
--- plr5501-testcase.py+++ plr5501-testcase.py@@ -5,10 +5,6 @@
if self.x:
if self.y.z(thing):
return True
- else:- # This comment should not be eaten by automated fixes,- # because it explains important context about the next if block.- # I would be quite sad if it vanished, because I'm quite fond of it.- if self.thing.color == thing.color_id:- return True+ elif self.thing.color == thing.color_id:+ return True
return False
Other info
Ruff 0.2.0 on a Mac.
I really, really liked that comment. 😭
I guess the best thing to do is to move the comment inside the elif?
The text was updated successfully, but these errors were encountered:
Sorry! We're trying to figure out what fix safety looks like with dropping comments. Retaining comments is really hard and we'd need to invest quite a bit to never drop them, but we're hoping to have a way to treat fixes as unsafe if there's a comment in the edit range.
plr5501-testcase.py
ruff --select=PLR5501 --isolated --diff plr5501-testcase.py
Other info
elif
?The text was updated successfully, but these errors were encountered: