-
-
Notifications
You must be signed in to change notification settings - Fork 266
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
FIX #159 enum hash auto correct for % arrays #163
FIX #159 enum hash auto correct for % arrays #163
Conversation
lib/rubocop/cop/rails/enum_hash.rb
Outdated
def source(elem) | ||
case elem.type | ||
when :str | ||
"\"#{elem.value}\"" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess String#dump
is better than the string interpolation. String#dump
returns eval-safe string.
Can you replace it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course ! Than you for this I tried to find a way to do so !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like the Symbol#inspect do exactly the same ! Replaced 👍
This looks good to me. Could you squash your commits into one? |
👍 My bad, though it was during the merge / squash. |
80857ed
to
4d79291
Compare
Thanks! |
update code and tests so autocorrect for enum hash handle % array notations such as
%w[done todo archived]
are well corrected