Update shellcheck for new tool support and better parsing.

Review Request #11576 — Created April 5, 2021 and updated

chipx86
ReviewBot
release-3.0.x
reviewbot

This updates ShellCheckTool to subclass the newer BaseTool, and to
use the newer features it offers (dependencies, improved file pattern
support, central command building, new loggers, and new comment
options).

The list of file types and shebangs supported have been extended, based
on shellcheck's advertised capabilities.

The handling of shellcheck results has been improved. We now request
JSON output, and use that to convey column, error code, and severity
information.

The payload also provides suggested fixes, in the form of "replacement"
ranges. These are used to modify the referenced line(s) of code and
patch them up to provide a possible replacement line of code. The new
tool support will provide the resulting replacements in the comment, if
we're able to successfully apply them without any issues. This is
future-proofed to back out of the attempt if we see anything we don't
expect from shellcheck.

If anything goes wrong with parsing files or handling settings, the
resulting error is left as a comment on the file.

Unit tests passed on Python 2.7 and 3.x.

Summary
Update shellcheck for new tool support and better parsing.
Description From Last Updated

Copy-pasteo: pyflakes -> shellcheck. Mind checking your other changes to make sure I didn't miss this in the things I've ...

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

    Copy-pasteo: pyflakes -> shellcheck. Mind checking your other changes to make sure I didn't miss this in the things I've already reviewed?

  3. 
      
Loading...