Search code examples
bundlerrubyminerubocop

Unable to parse RuboCop response in Rubymine 2019.3


Rubymine reports that it's unable to parse the output from rubocop in my project.

enter image description here

When I click the details link, this is what it shows:

Error:Bundle complete! 13 Gemfile dependencies, 68 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
{"metadata":{"rubocop_version":"0.80.1","ruby_engine":"ruby","ruby_version":"2.6.3","ruby_patchlevel":"62","ruby_platform":"x86_64-darwin18"},"files":[{"path":"db/seeds.rb","offenses":[{"severity":"convention","message":"Missing frozen string literal comment.","cop_name":"Style/FrozenStringLiteralComment","corrected":false,"correctable":true,"location":{"start_line":1,"start_column":1,"last_line":1,"last_column":1,"length":1,"line":1,"column":1}},{"severity":"convention","message":"Line is too long. [103/80]","cop_name":"Layout/LineLength","corrected":false,"correctable":true,"location":{"start_line":1,"start_column":81,"last_line":1,"last_column":103,"length":23,"line":1,"column":81}},{"severity":"convention","message":"Line is too long. [111/80]","cop_name":"Layout/LineLength","corrected":false,"correctable":true,"location":{"start_line":2,"start_column":81,"last_line":2 ...

I'm assuming the problem is related to the extra bundler output that is getting parsed, in addition to the JSON. Any ideas of how I can fix this?


Solution

  • Some people say if you upgrade Rubocop to 0.88 or later, it fixes. I tested myself and can confirm.

    See the discussion: https://youtrack.jetbrains.com/issue/RUBY-26861