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

# rubocop:disable Style/Documentation will be matched as valid documentation #3807

Closed
PascalTurbo opened this issue Dec 20, 2016 · 0 comments
Labels

Comments

@PascalTurbo
Copy link

Expected behavior

When using a rubocop:disable tag, it shouldn't be matched as a valid documentation

Actual behavior

When using a rubocop:disabled tag it is detected as documentation which leads to a chicken-and-egg question.

Steps to reproduce the problem

  # rubocop:disable Style/Documentation
  # rubocop:disable Style/DocumentationMethod
  class Time
    def self.parse(t)
      # do something
    end
  end

This example will lead to a Unnecessary disabling of Style/Documentation. Message because rubocop thinks, that the disable part is a valid Documentation of that part of code.

RuboCop version

$ rubocop -V
0.46.0 (using Parser 2.3.3.1, running on ruby 2.3.0 x86_64-darwin15)
@bbatsov bbatsov added the bug label Dec 20, 2016
Drenmi added a commit to Drenmi/rubocop that referenced this issue Dec 20, 2016
The documentation cops `Style/Documentation` and
`Style/DocumentationMethod` would mistake RuboCop directives for class
documentation. This change fixes that.
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