-
-
Notifications
You must be signed in to change notification settings - Fork 3.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
LineLength: add an IgnoreComments parameter #977
Comments
In such cases I would use # rubocop:disable LineLength
# section containing unbreakable long comments
# rubocop:enable LineLength That would disable the cop in just the special part of the code that can't conform. Generally speaking, long comment lines are just as bad as long code lines, so I'd prefer leaving the checks enabled to the largest possible extent. |
Ok, this makes sense. I’ll see how well the rest of the team likes this. ;) |
I agree to the “long comment lines are just as bad as long code lines”, but at the same time I think putting |
Maybe. I was thinking that such a problem exists in the code as well: URL = 'http://veeeerrryyyyyyy.looooooooooooong-boooooooooooring-naaaaaaaaaaaaame.com' |
Good argument for URL shorteners. We've been using Bit.ly, coupled with explanatory comments, when we run into things like that. Yes, shorteners kill semantics and bring in an outside dependency, but does anyone have any better ideas? We'd experimented with a |
Sometimes comments contain lines that can’t be easily wrapped (like URLs). Currently, the only way to not trigger LineLength with such comments is to exclude the whole file.
I think it would make sense to add an IgnoreComments parameter to LineLength, so that such comments wouldn’t trigger the cop.
The text was updated successfully, but these errors were encountered: