prontolabs / pronto-rubocop

Pronto runner for Rubocop, ruby code analyzer
MIT License
80 stars 74 forks source link

Pronto Rubocop is missing info severity #73

Closed arianf closed 2 years ago

arianf commented 2 years ago

Pronto Rubocop is missing info severity

https://github.com/prontolabs/pronto-rubocop/blob/2dc440f29248cfcc382b10ce345126a984d2cb7d/lib/pronto/rubocop/offense_line.rb#L120-L126

Traceback (most recent call last):
  26: from /Users/arian/.rvm/gems/ruby-2.5.8@my-app/bin/pronto:23:in `<main>'
  25: from /Users/arian/.rvm/gems/ruby-2.5.8@my-app/bin/pronto:23:in `load'
  24: from /Users/arian/.rvm/gems/ruby-2.5.8@my-app/gems/pronto-0.11.0/bin/pronto:6:in `<top (required)>'
  23: from /Users/arian/.rvm/gems/ruby-2.5.8@my-app/gems/thor-1.1.0/lib/thor/base.rb:485:in `start'
  22: from /Users/arian/.rvm/gems/ruby-2.5.8@my-app/gems/thor-1.1.0/lib/thor.rb:392:in `dispatch'
  21: from /Users/arian/.rvm/gems/ruby-2.5.8@my-app/gems/thor-1.1.0/lib/thor/invocation.rb:127:in `invoke_command'
  20: from /Users/arian/.rvm/gems/ruby-2.5.8@my-app/gems/thor-1.1.0/lib/thor/command.rb:27:in `run'
  19: from /Users/arian/.rvm/gems/ruby-2.5.8@my-app/gems/pronto-0.11.0/lib/pronto/cli.rb:64:in `run'
  18: from /Users/arian/.rvm/gems/ruby-2.5.8@my-app/gems/pronto-0.11.0/lib/pronto/cli.rb:64:in `chdir'
  17: from /Users/arian/.rvm/gems/ruby-2.5.8@my-app/gems/pronto-0.11.0/lib/pronto/cli.rb:66:in `block in run'
  16: from /Users/arian/.rvm/gems/ruby-2.5.8@my-app/gems/pronto-0.11.0/lib/pronto.rb:66:in `run'
  15: from /Users/arian/.rvm/gems/ruby-2.5.8@my-app/gems/pronto-0.11.0/lib/pronto/runners.rb:13:in `run'
  14: from /Users/arian/.rvm/gems/ruby-2.5.8@my-app/gems/pronto-0.11.0/lib/pronto/runners.rb:13:in `each'
  13: from /Users/arian/.rvm/gems/ruby-2.5.8@my-app/gems/pronto-0.11.0/lib/pronto/runners.rb:20:in `block in run'
  12: from /Users/arian/.rvm/gems/ruby-2.5.8@my-app/gems/pronto-rubocop-0.11.1/lib/pronto/rubocop.rb:13:in `run'
  11: from /Users/arian/.rvm/gems/ruby-2.5.8@my-app/gems/pronto-rubocop-0.11.1/lib/pronto/rubocop.rb:13:in `flat_map'
  10: from /Users/arian/.rvm/gems/ruby-2.5.8@my-app/gems/pronto-rubocop-0.11.1/lib/pronto/rubocop.rb:13:in `each'
   9: from /Users/arian/.rvm/gems/ruby-2.5.8@my-app/gems/pronto-rubocop-0.11.1/lib/pronto/rubocop.rb:13:in `block in run'
   8: from /Users/arian/.rvm/gems/ruby-2.5.8@my-app/gems/pronto-rubocop-0.11.1/lib/pronto/rubocop/patch_cop.rb:16:in `messages'
   7: from /Users/arian/.rvm/gems/ruby-2.5.8@my-app/gems/pronto-rubocop-0.11.1/lib/pronto/rubocop/patch_cop.rb:16:in `flat_map'
   6: from /Users/arian/.rvm/gems/ruby-2.5.8@my-app/gems/pronto-rubocop-0.11.1/lib/pronto/rubocop/patch_cop.rb:16:in `each'
   5: from /Users/arian/.rvm/gems/ruby-2.5.8@my-app/gems/pronto-rubocop-0.11.1/lib/pronto/rubocop/patch_cop.rb:20:in `block in messages'
   4: from /Users/arian/.rvm/gems/ruby-2.5.8@my-app/gems/pronto-rubocop-0.11.1/lib/pronto/rubocop/patch_cop.rb:20:in `map'
   3: from /Users/arian/.rvm/gems/ruby-2.5.8@my-app/gems/pronto-rubocop-0.11.1/lib/pronto/rubocop/patch_cop.rb:20:in `block (2 levels) in messages'
   2: from /Users/arian/.rvm/gems/ruby-2.5.8@my-app/gems/pronto-rubocop-0.11.1/lib/pronto/rubocop/offense_line.rb:13:in `message'
   1: from /Users/arian/.rvm/gems/ruby-2.5.8@my-app/gems/pronto-rubocop-0.11.1/lib/pronto/rubocop/offense_line.rb:103:in `level'
/Users/arian/.rvm/gems/ruby-2.5.8@my-app/gems/pronto-rubocop-0.11.1/lib/pronto/rubocop/offense_line.rb:103:in `fetch': key not found: :info (KeyError)
arianf commented 2 years ago

See https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Severity and https://github.com/rubocop/rubocop/pull/9391

arianf commented 2 years ago

It should probably map to :info

 DEFAULT_SEVERITIES = { 
   info: :info,
   refactor: :warning, 
   convention: :warning, 
   warning: :warning, 
   error: :error, 
   fatal: :fatal 
 }.freeze