-
Notifications
You must be signed in to change notification settings - Fork 108
Closed
Labels
Description
I like the idea of using B950 over E501, but I do not want to be warned anytime I include a long URL in a comment. Breaking URLs over multiple lines is not acceptable as I want them to be clickable.
pycodestyle addresses this by making an exemption to the line length error for comments that contain no whitespace. See line 304 (currently) of pycodestyle.py:
# Special case for long URLs in multi-line docstrings or
# comments, but still report the error when the 72 first chars
# are whitespaces.
chunks = line.split()
if ((len(chunks) == 1 and multiline) or
(len(chunks) == 2 and chunks[0] == '#')) and \
len(line) - len(chunks[-1]) < max_line_length - 7:
return
I propose adding a similar exemption to flake8-bugbear. Of course, I could add a # noqa
comment after every URL comment, but I much prefer pycodestyle's solution.
jkowalleck