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

Recommendation for a comment that contains a very long url #712

Open
jonahx opened this issue Apr 23, 2018 · 5 comments
Open

Recommendation for a comment that contains a very long url #712

jonahx opened this issue Apr 23, 2018 · 5 comments

Comments

@jonahx
Copy link

jonahx commented Apr 23, 2018

For example:

# for a detailed explanation of the history of this prefix see:
# https://github.com/bbatsov/some-really-really-really-really-really-really-longer-than-80-chars-url
name_prefix = "SDF_"

In code, we have multiple methods to split up a long literal string across lines while respecting the 80 character limit.

Is there a solution in this case? If not, does the style guide have a recommendation?

@eliotsykes
Copy link
Contributor

eliotsykes commented Apr 23, 2018

I didn't find anything in the style guide, but some part-solution options that could be considered alone or together:

  • Use a trusted URL shortener
  • Move the URL to the commit message
  • Use a custom annotation like WHY or HISTORY to hint to the developer to refer to the commit history

@eliotsykes
Copy link
Contributor

Related, the AllowURI option of Rubocop's LineLength rule http://rubocop.readthedocs.io/en/latest/cops_metrics/#metricslinelength

@jonahx
Copy link
Author

jonahx commented Apr 24, 2018

@eliotsykes thanks. does that mean that the default for rubocop is to ignore violations of the 80 char limit if those violations are a URI?

@eliotsykes
Copy link
Contributor

@jonahx That's what those docs suggest.

@bbatsov
Copy link
Collaborator

bbatsov commented Jun 12, 2019

I guess we should mention this in the guide as well.

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