Recommendation for a comment that contains a very long url
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?
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
WHYorHISTORYto hint to the developer to refer to the commit history
Related, the AllowURI option of Rubocop's LineLength rule http://rubocop.readthedocs.io/en/latest/cops_metrics/#metricslinelength
@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?
@jonahx That's what those docs suggest.
I guess we should mention this in the guide as well.