-
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
[pycodestyle
] Implement redundant-backslash
(E502
)
#10292
[pycodestyle
] Implement redundant-backslash
(E502
)
#10292
Conversation
pycodestyle
] Implement redundant-backslash (
E502`)pycodestyle
] Implement redundant-backslash
(E502
)
|
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
E502 | 4 | 4 | 0 | 0 | 0 |
Formatter (stable)
✅ ecosystem check detected no format changes.
Formatter (preview)
✅ ecosystem check detected no format changes.
} | ||
cursor += c.len_utf8(); | ||
} | ||
} |
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.
We have a struct called Indexer
that already stores the locations of all continuations (i.e., the line positions following a \
). I'm wondering if we could instead iterate over the token stream, identify parenthesized ranges, and then search for continuation_lines
offsets within parenthesized ranges?
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.
Done
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.
Thanks, this looks good to me.
One more step towards #9057 🎉 |
Summary
Implements the redundant-backslash rule (E502) from pycodestyle.
Test Plan
New fixture has been added
Part of #2402