Skip to content
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

noqa'ing multi-line strings with B950 works differently than with E501 #56

Closed
mineo opened this issue Jan 13, 2019 · 2 comments
Closed

Comments

@mineo
Copy link

mineo commented Jan 13, 2019

(tmp-961236c5487a52a) ↪ flake8 --version                     
3.6.0 (flake8-bugbear: 18.8.0, flake8-docstrings: 1.3.0, pydocstyle: 3.0.0, flake8-print: 3.1.0, flake8-todo: 0.7, mccabe: 0.6.1, naming: 0.7.0, pycodestyle: 2.4.0, pyflakes: 2.0.0) CPython 3.7.2 on Linux
(tmp-961236c5487a52a) ↪ cat testfile.py 
#!/usr/bin/env python
"""
strftime documentation: https://docs.python.org/2/library/datetime.html?highlight=datetime#strftime-strptime-behavior
""" # noqa
(tmp-961236c5487a52a) ↪ flake8 --select=E501,B950 testfile.py
testfile.py:3:118: B950 line too long (117 > 80 characters)

The following version works:

(tmp-961236c5487a52a) ↪ cat testfile.py          
#!/usr/bin/env python
"""
strftime documentation: https://docs.python.org/2/library/datetime.html?highlight=datetime#strftime-strptime-behavior # noqa
"""
(tmp-961236c5487a52a) ↪ flake8 --select=E501,B950 testfile.py
(tmp-961236c5487a52a) ↪

I find placing noqa after the (possibly very long) module docstring easier though, since I can then use as many long links in that block as I want. Also, for the example given, Sphinx 1.8.3 adds the #noqa part to the link :-(

@FozzieHi
Copy link
Contributor

@cooperlees This seems to be fine now, so can probably be closed.

@cooperlees
Copy link
Collaborator

Very true - Thanks for the nudge!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants