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

Performance/StringIdentifierArgument unsafe autocorrection #289

Closed
juanibiapina opened this issue May 18, 2022 · 2 comments · Fixed by #290
Closed

Performance/StringIdentifierArgument unsafe autocorrection #289

juanibiapina opened this issue May 18, 2022 · 2 comments · Fixed by #290
Labels
bug Something isn't working

Comments

@juanibiapina
Copy link

This cop autocorrects this:

Object.const_defined?('Rails::Console')

into

Object.const_defined?(:'Rails::Console')

Which then explodes with:

NameError (wrong constant name Rails::Console)

RuboCop version

$ [bundle exec] rubocop -V
1.26.0 (using Parser 3.1.2.0, rubocop-ast 1.18.0, running on ruby 2.7.6 x86_64-linux)
  - rubocop-performance 1.13.3
@koic koic added the bug Something isn't working label May 18, 2022
koic added a commit to koic/rubocop-performance that referenced this issue May 18, 2022
…ierArgument`

Fixes rubocop#289.

This PR fixes a false positive for `Performance/StringIdentifierArgument`
when using namespaced class string argument.
koic added a commit to koic/rubocop-performance that referenced this issue May 18, 2022
…ierArgument`

Fixes rubocop#289.

This PR fixes a false positive for `Performance/StringIdentifierArgument`
when using namespaced class string argument.
@koic koic closed this as completed in #290 May 21, 2022
koic added a commit that referenced this issue May 21, 2022
…e_string_identifier_argument

[Fix #289] Fix a false positive for `Performance/StringIdentifierArgument`
@juanibiapina
Copy link
Author

@koic awesome!

@koic
Copy link
Member

koic commented May 24, 2022

@juanibiapina Yeah, RuboCop Performance 1.14 has been released. Thank you for your feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants