Update Rubocop for new tool support and improved parsing.

Review Request #11578 — Created April 6, 2021 and updated

chipx86
ReviewBot
release-3.0.x
reviewbot

This updates RubocopTool to subclass the newer BaseTool, and to use
the newer features it offers (dependencies, improved file extension
handling, centralized base command building, and new comment options).

The parsing has been redone to use the Rubocop JSON output, which
constains details such as line/column ranges and error codes. It also
tells Rubocode to provide URLs to any relevant docs when reporting
errors, and forces it not to comment on filenames (which can fail
depending on the temp filename that's created).

If we're unable to parse the JSON payload, we split the lines and use
the first line as an error. This seems to be the most reliable option,
as subsequent lines can end up with stack traces or "successful" JSON
payloads.

Unit tests pass on Python 2.7 and 3.x.

Summary
Update Rubocop for new tool support and improved parsing.
Description From Last Updated

pyflakes -> rubocop

daviddavid
Checks run (2 succeeded)
flake8 passed.
JSHint passed.
david
  1. 
      
  2. bot/reviewbot/tools/rubocop.py (Diff revision 1)
     
     

    pyflakes -> rubocop

  3. 
      
Loading...