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
Version: 0.0.284 Config: No config. Just evaluating ruff. Command: ruff src --isolated --fix
Codebase uses lambdas as values in an Enum. Whether that be considered a nice trick or not, it certainly doesn't work if those assignments are turned into methods.
classTemperatureScales(Enum):
CELSIUS= (lambdadeg_c: deg_c)
FAHRENHEIT= (lambdadeg_c: deg_c*9/5+32)
# will not work if converted to:classTemperatureScales(Enum):
defCELSIUS(deg_c):
returndeg_cdefFAHRENHEIT(deg_c):
returndeg_c*9/5+32
The text was updated successfully, but these errors were encountered:
Adamantish
changed the title
Autofix breaks code: lambda-assignment
Autofix breaks code: lambda-assignment in class body
Aug 16, 2023
Thanks! It turns out that we already mark this as a manual-only fix when it's within a class. So it will automatically be avoided once we start respecting those annotations in the CLI.
Closing this optimistically as we've now marked these as "manual only" fixes. Once we respect those annotations in the CLI, we'll avoid these breakages in the future (though the violations themselves will still be raised, so either way I'd suggest a # noqa here). Thanks again for reporting!
Version: 0.0.284
Config: No config. Just evaluating ruff.
Command:
ruff src --isolated --fix
Codebase uses lambdas as values in an
Enum
. Whether that be considered a nice trick or not, it certainly doesn't work if those assignments are turned into methods.The text was updated successfully, but these errors were encountered: