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

Hash value ommission from Ruby-3.1 #15

Closed
fonji opened this issue Apr 17, 2023 · 8 comments
Closed

Hash value ommission from Ruby-3.1 #15

fonji opened this issue Apr 17, 2023 · 8 comments

Comments

@fonji
Copy link

fonji commented Apr 17, 2023

Hash value omission was introduced with ruby 3.1 - rubyreferences.github.io/rubychanges/3.1.html#values-in-hash-literals-and-keyword-arguments-can-be-omitted

And apparently it breaks flog:

ERROR: parsing ruby file example.rb
Racc::ParseError: example.rb:5 :: parse error on value "," (tCOMMA) at:
  /usr/local/lib/ruby/2.6.0/racc/parser.rb:528:in `on_error'
  /usr/local/bundle/gems/ruby_parser-3.13.1/lib/ruby_parser_extras.rb:1179:in `on_error'
  /usr/local/lib/ruby/2.6.0/racc/parser.rb:259:in `_racc_do_parse_c'
  /usr/local/lib/ruby/2.6.0/racc/parser.rb:259:in `do_parse'
  /usr/local/bundle/gems/ruby_parser-3.13.1/lib/ruby_parser_extras.rb:1086:in `block in process'

example.rb content:

# frozen_string_literal: true

class Example
  def perform(id)
    Model.find_by!(id:, something: :else)
  end
end

This is also happens to the duplication engine (codeclimate/codeclimate-duplication#375)

Thanks

@fonji
Copy link
Author

fonji commented Apr 17, 2023

Updating ruby_parser may do the trick
https://github.com/seattlerb/ruby_parser/blob/master/History.rdoc

@mlinderman
Copy link

Thanks @fonji! The Quality team at Code Climate is making a concerted effort to upgrade all plug-ins, since some have been neglected for a while. I'll bump up codeclimate-flog's priority. Please keep in touch with our changelog for updates.

@fonji
Copy link
Author

fonji commented Apr 17, 2023

Thanks @mlinderman, I'm glad to hear that! 😃

@dantevvp
Copy link

Hey @fonji ! A new version of codeclimate-flog is now up to support the latest ruby_parser version. Thanks for your contribution!

@fonji
Copy link
Author

fonji commented May 31, 2023

That's awesome! Thanks @dantevvp ❤️

@fonji fonji closed this as completed May 31, 2023
@fonji
Copy link
Author

fonji commented Jun 6, 2023

Thanks for the shoutout in the changelog! 💕
I set up the channel as channel: flog-4-6-6, but I still have problems with hash value ommissions.
Did I miss something?

@fonji fonji reopened this Jun 6, 2023
@dantevvp
Copy link

dantevvp commented Jun 6, 2023

Hey @fonji !

Are you having issues when using the CLI? Or is it when analysing PRs on Github? If it's the latter, there might have been a delay in the update. Try running your analyses again and if any other issues arise let me know!

@fonji
Copy link
Author

fonji commented Jun 7, 2023

Oh you're right! It was when analysing PRs on Github, I pushed again just now and got my issues back.
Sorry for the false positive, and thank you once again!

@fonji fonji closed this as completed Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants