You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From the documentation it seems like a trailing line # rubocop:disable LineLength should disable LineLength for only that line, however the following file passes rubocop version 0.18.1:
# This class has some class-level documentation that tells you all about how
# great it is.
class MyClass
puts 'This is a very long line, but we will tell Rubocop to ignore it because it is very important to us.' # rubocop:disable LineLength
puts 'This line on the other hand is awful and really needs to be refactored, so Rubocop should alert us about that.'
end
If I remove the disable comment, both lines are reported as violations.
Is this a bug, or am I misunderstanding the purpose of single-line disable comments?
Edit: If I am misunderstanding the purpose of the end-of-line comment, then I'll submit a feature request to have something like # rubocop:skip CopName for exactly this purpose.
The text was updated successfully, but these errors were encountered:
Last time I used git bisect I got it wrong, but maybe this time the result is correct. It should be this commit that introduced the bug. Seems likely looking at the commit message. (Although looking at the date one can't help but wonder if this feature is used much.)
commit 3b7d7cb16bb98fda62511bb311e65dbe7cc8df4c
Author: Yuji Nakayama <nkymyj@gmail.com>
Date: Sat Jul 13 16:03:36 2013 +0900
Refactor SourceParser#disabled_lines_in and improve performance
From the documentation it seems like a trailing line
# rubocop:disable LineLength
should disable LineLength for only that line, however the following file passes rubocop version 0.18.1:If I remove the disable comment, both lines are reported as violations.
Is this a bug, or am I misunderstanding the purpose of single-line disable comments?
Edit: If I am misunderstanding the purpose of the end-of-line comment, then I'll submit a feature request to have something like
# rubocop:skip CopName
for exactly this purpose.The text was updated successfully, but these errors were encountered: