-
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
Do not enforce line length limit for long URL in docstrings #3051
Comments
For what it's worth, we do allow this: class Foo:
"""
See:
https://looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong.url.com
""" That is: if the URL is on its own line, we don't flag it. Is that sufficient? |
Probably OK for this case but for consistency, it's a little cumbersome for a short URL. class Foo:
"""
See:
https://short.url.com/
""" v.s. class Foo:
"""
@see https://short.url.com/
""" Okay... so there are various common docstring formats. Not sure how much performance impact it would be for detecting a line is ended with a URL in a multiline string... but it sounds slow. |
Another issue where I've run into this when I recently started using ruff (wonderful tool, by the way!) is in RST text substitution links, something like the following: .. _named link on long line 1: https://qwertyyuiopasdfghjklzxcvbnm.qwertyyuiopasdfghjklzxcvbnm.org/
.. _named link on long line 2: https://qwertyyuiopasdfghjklzxcvbnm.com/qwertyyuiopasdfghjklzxcvbnm.html#anchor_tag_1 |
Similar to #920 but in docstring
The text was updated successfully, but these errors were encountered: