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

Extra rubocop:disable makes cop enabled #2546

Closed
jonas054 opened this issue Dec 28, 2015 · 2 comments
Closed

Extra rubocop:disable makes cop enabled #2546

jonas054 opened this issue Dec 28, 2015 · 2 comments
Assignees
Labels

Comments

@jonas054
Copy link
Collaborator

In #1690, @HaleTom wrote

I have seen redundant disable comments being flagged. What I don't get is that second one here is not flagged though... and it actually CAUSES a warning???!!!

# make rubocop happy
class Passes
  # rubocop:disable Style/ClassVars
  @@class_var = 'no problems here'
end

# make rubocopy sad
class Offensive
  # Removing the next comment line makes for a happy rubocop - why?
  # rubocop:disable Style/ClassVars
  @@class_var = 'broken?'
end
@jonas054 jonas054 added the bug label Dec 28, 2015
@jonas054 jonas054 self-assigned this Dec 28, 2015
@jonas054
Copy link
Collaborator Author

Removing the second rubocop:disable makes Style/ClassVars disabled from line 3 to the end of the file. This is normal. The bug is that the second rubocop:disable Style/ClassVars seems to make the first one ineffective.

bbatsov added a commit that referenced this issue Dec 30, 2015
[Fix #2546] Handle double rubocop:disable of a cop
@alexdowad
Copy link
Contributor

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants