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

False positive for Lint/ToEnumArguments #12746

Closed
marocchino opened this issue Mar 6, 2024 · 0 comments · Fixed by #12747
Closed

False positive for Lint/ToEnumArguments #12746

marocchino opened this issue Mar 6, 2024 · 0 comments · Fixed by #12747
Labels

Comments

@marocchino
Copy link
Contributor

It seems a bit odd to have the call pass all arguments even though there are no arguments.

Expected behavior

No Offence

Actual behavior

$ echo "def m; to_enum(:not_m); end" | bundle exec rubocop --stdin test.rb --only Lint/ToEnumArguments
Inspecting 1 file
W

Offenses:

test.rb:1:8: W: Lint/ToEnumArguments: Ensure you correctly provided all the arguments.
def m; to_enum(:not_m); end
       ^^^^^^^^^^^^^^^

Steps to reproduce the problem

see Actual behavior

RuboCop version

$ rubocop -V
1.60.2 (using Parser 3.3.0.5, rubocop-ast 1.30.0, running on ruby 3.1.3) [arm64-darwin22]
  - rubocop-capybara 2.20.0
  - rubocop-factory_bot 2.25.1
  - rubocop-performance 1.20.2
  - rubocop-rails 2.23.1
  - rubocop-rspec 2.26.1
@koic koic added the bug label Mar 6, 2024
koic added a commit to koic/rubocop that referenced this issue Mar 6, 2024
Fixes rubocop#12746.

This PR fixes a false positive for `Lint/ToEnumArguments`
when enumerator is created for another method in no arguments method definition.
koic added a commit to koic/rubocop that referenced this issue Mar 6, 2024
Fixes rubocop#12746.

This PR fixes a false positive for `Lint/ToEnumArguments`
when enumerator is created for another method in no arguments method definition.
koic added a commit to koic/rubocop that referenced this issue Mar 6, 2024
Fixes rubocop#12746.

This PR fixes a false positive for `Lint/ToEnumArguments`
when enumerator is created for another method in no arguments method definition.
koic added a commit to koic/rubocop that referenced this issue Mar 6, 2024
Fixes rubocop#12746.

This PR fixes a false positive for `Lint/ToEnumArguments`
when enumerator is created for another method in no arguments method definition.
bbatsov pushed a commit that referenced this issue Mar 6, 2024
Fixes #12746.

This PR fixes a false positive for `Lint/ToEnumArguments`
when enumerator is created for another method in no arguments method definition.
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