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

Lint/UselessMethodDefinition false positive on methods transformed by class method #11704

Closed
Thibaut opened this issue Mar 16, 2023 · 0 comments · Fixed by #11705
Closed

Lint/UselessMethodDefinition false positive on methods transformed by class method #11704

Thibaut opened this issue Mar 16, 2023 · 0 comments · Fixed by #11705
Labels

Comments

@Thibaut
Copy link

Thibaut commented Mar 16, 2023

Expected behavior

The following code should not get picked up / auto-corrected by the UselessMethodDefinition cop:

memoize def my_method
  super
end

(illustrated here in conjunction with Memery, but this applies more generally)

Actual behavior

The code gets auto-corrected to the following invalid code:

memoize
@koic koic added the bug label Mar 16, 2023
koic added a commit to koic/rubocop that referenced this issue Mar 18, 2023
…ition`

Fixes rubocop#11704.

This PR fixes a false positive for `Lint/UselessMethodDefinition`
when method definition with non access modifier containing only `super` call.
bbatsov pushed a commit that referenced this issue Mar 18, 2023
Fixes #11704.

This PR fixes a false positive for `Lint/UselessMethodDefinition`
when method definition with non access modifier containing only `super` call.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants