-
Notifications
You must be signed in to change notification settings - Fork 107
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
Allow the same special cases for B950 as E501 (#176) #213
Conversation
81c2020
to
bf5f79e
Compare
bf5f79e
to
d77e974
Compare
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 for this. Tests look sane to test the code. Would like the version change removed (as that version is never going to exist) and just answer my question about the code logic.
bugbear.py
Outdated
@@ -12,7 +12,7 @@ | |||
import attr | |||
import pycodestyle | |||
|
|||
__version__ = "21.11.29" | |||
__version__ = "21.12.0" |
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.
Lets not do this here and I'll do it on a diff when I release (as it's going to be 22.*)
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.
addressed
|
||
is_line_comment_url_path = len(chunks) == 2 and chunks[0] == "#" | ||
|
||
just_long_url_path = len(chunks) == 1 |
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.
So if I read this right, really this is just a long no white space string right? So it could not be a URL or file path? I guess generally we'll have spaces I guess is the rationale here right?
Is this the same as how pycodestyle does it? if so, (Sorry - being lazy and not checking), then I guess it's proven to be safe enough.
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.
Yeah, a long string with no white space, which is mostly just URLs and paths. A path that has a space in it will still fail but would also fail E501. Rational is it is more readable to not split up URLs and paths in comments and code.
It's the same logic as pycodestyle, modified to be a bit more readable to me. Linking here for convenience.
Fixes #176
Allows for the same special cases as E501 for B950