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

Style/Documentation macro-only check is incorrect #11293

Closed
ghiculescu opened this issue Dec 15, 2022 · 0 comments · Fixed by #11294
Closed

Style/Documentation macro-only check is incorrect #11293

ghiculescu opened this issue Dec 15, 2022 · 0 comments · Fixed by #11294

Comments

@ghiculescu
Copy link
Contributor

This does not get a lint error:

class Thing < ApplicationRecord
  belongs_to :user
end

I think it should, because it is a class with legitimate contents, but no documentation.

I think the changes made in #8812 have introduced a false positive.


Expected behavior

Style/Documentation lint error, as the class has no documentation.

Actual behavior

No lint error.

RuboCop version

1.40.0 (using Parser 3.1.3.0, rubocop-ast 1.24.0, running on ruby 3.1.3) [x86_64-darwin20]
  - rubocop-minitest 0.25.0
  - rubocop-performance 1.15.1
  - rubocop-rails 2.17.3
  - rubocop-thread_safety 0.4.4
koic added a commit to koic/rubocop that referenced this issue Dec 16, 2022
Fixes rubocop#11293.

This PR fixes a false negative for `Style/Documentation`
when using custom macro.

The built-in macros (e.g. `include`, `extend`, `prepend`) and
DSL like `belongs_to` should be treated differently.
Only `include`, `extend`, and `prepend` will be needed to resolve rubocop#8788.
bbatsov pushed a commit that referenced this issue Dec 20, 2022
Fixes #11293.

This PR fixes a false negative for `Style/Documentation`
when using custom macro.

The built-in macros (e.g. `include`, `extend`, `prepend`) and
DSL like `belongs_to` should be treated differently.
Only `include`, `extend`, and `prepend` will be needed to resolve #8788.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant