reviewdog / action-rubocop

Run rubocop with reviewdog 🐶
MIT License
115 stars 75 forks source link

Fix severity conversion; calculate overall severity based on RuboCop fail level #84

Closed reidab closed 1 year ago

reidab commented 1 year ago

RuboCop's severity levels are represented by RuboCop::Cop::Severity objects, not symbols. Internally, this objects holds a symbol in its name attribute an implements comparison methods.

Sadly, these comparisons aren't reversable: severity === :info => true, but :info === severity => false.

The ruby case statement performs tripple-equals comparisons with the argument to the when clause as the first operand, so the existing case statement always returned UNKNOWN_SEVERITY.

In addition to fixing the above issue, this PR adds mappings for the non-standard RuboCop convention and refactor severity levels to INFO and calculates a top-level severity value in the rdjson output based on RuboCop's configured fail level.

Fixes #75

mgrachev commented 1 year ago

@reidab Thank for your contribution 👍

Before merging, please fix CI builds in your PR 🙏

reidab commented 1 year ago

Okay, that should be cleaned up now.

github-actions[bot] commented 1 year ago

🚀 [bumpr] Bumped! New version:v2.3.3 Changes:v2.3.2...v2.3.3

review-dog commented 1 year ago

Hi, @reidab! We merged your PR to reviewdog! 🐶 Thank you for your contribution! ✨

We just invited you to join the @reviewdog organization on GitHub. Accept the invite by visiting https://github.com/orgs/reviewdog/invitation. By joining the team, you'll be a part of reviewdog community and can help the maintenance of reviewdog.

Thanks again!