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/SymbolConversion false positive for Hash keys that end with "=" #9457

Closed
s-mage opened this issue Jan 29, 2021 · 0 comments · Fixed by #9467
Closed

Lint/SymbolConversion false positive for Hash keys that end with "=" #9457

s-mage opened this issue Jan 29, 2021 · 0 comments · Fixed by #9467
Labels

Comments

@s-mage
Copy link

s-mage commented Jan 29, 2021

@koic

Can you please open a new another issue?

Sure, here you go. Ruby allows symbols that end with =, but gives syntax error for such Hash keys.

{ "one=": 1 } # [Lint/SymbolConversion] [W]  Unnecessary symbol conversion; use `one=:` instead. ...
> x = :one=
=> :one=
> { one=: 1 }
SyntaxError: unexpected ':'
{ one=: 1 }
      ^
> { :one= => 1 }
=> {:one==>1}
> { "one=": 1 }
=> {:one==>1}
@koic koic added the bug label Jan 29, 2021
koic added a commit to koic/rubocop that referenced this issue Jan 29, 2021
Fixes rubocop#9457.

This PR fixes a false positive for Lint/SymbolConversion when hash keys
that end with `=`.
dvandersluis added a commit that referenced this issue Jan 29, 2021
…ol_conversion

[Fix #9457] Fix a false positive for `Lint/SymbolConversion`
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