-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UP032 became less useful in v0.3.1 #10259
Comments
Ran into this too with a bunch of tedious fixes. An unsafe autofix would be great to just have to deal with the line length afterward. Running the |
I've enabled the autofix for these new violations here: #10263. |
Part of the problem is we don't really have a mechanism for gating by line length -- it's not really the intent of fix safety, which is intended to capture changes in the semantics and meaning of the code. So in that PR, I've made it a safe fix regardless. There's some discussion on the broader issue here, if anyone has opinions: #8106. |
Merged! |
The whole change in that rule to trigger even when it causes a longer line feels kind of annoying and the fact that there's no autofix doesn't make it better: Fixing it requires manual work anyway, but I'd rather start from a too-long line which I just need to wrap somehow, than having to do the whole fix myself. --> Couldn't it simply be an unsafe autofix in such cases?
Some example where just using f-string isn't great / very readable:
(of course this one can easily be refactored to separate statements and then a nicely compact f-string)
In this case an f-string do not provide the same level of functionality. And this happens to be part of an sqlalchemy
__table_args__
class attribute, so moving the assignment to a separate statement would clutter the class scope (or require an explicitdel t
afterwards).The text was updated successfully, but these errors were encountered: