-
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
RUF022, RUF023: never add two trailing commas to the end of a sequence #9698
Conversation
|
ℹ Safe fix | ||
241 241 | ] | ||
242 242 | | ||
243 243 | __all__ = ( | ||
244 |- "foo" | ||
245 244 | # strange comment 1 | ||
246 |- , | ||
247 245 | # comment about bar | ||
248 |- "bar" | ||
246 |+ "bar", | ||
247 |+ "foo" | ||
249 248 | # strange comment 2 | ||
250 249 | , | ||
251 250 | ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's hard to say where a comment like # strange comment 1
should go really, if it lies between the string item and the associated comma. Possibly it should move with "foo"
, even though it's directly above "bar"
. But this is a very unlikely edge case, and the important thing is that the comment isn't deleted, in my opinion.
Fixes the issues highlighted in #8402 (comment) and #8402 (comment)