reviewdog / action-rubocop

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

Don't let stderr impact result parsing #82

Closed bmulholland closed 1 year ago

bmulholland commented 1 year ago

When using some ruby versions, parser often outputs a warning to stderr: https://github.com/whitequark/parser/blob/c44b23d54f9074d0ea5631af8bfd602fe26153fc/lib/parser/current.rb#L5

This rarely has any impact, but it's still there, and (while it's hard to confirm) I believe that's still getting piped through to reviewdog. Since this gets inserted before the JSON output, the result is an error: reviewdog: failed to unmarshal rdjson (DiagnosticResult): proto: syntax error (line 1:1): unexpected token

To fix this, we add a pipe of stderr, where the warning comes in, and ignore it. This way, the JSON parsing runs only on valid stdout.

bmulholland commented 1 year ago

Not quite working yet

bmulholland commented 1 year ago

Okay, this was a red herring