Update shellcheck for new tool support and better parsing.
Review Request #11576 — Created April 5, 2021 and submitted
This updates
ShellCheckTool
to subclass the newerBaseTool
, 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 | ID |
---|---|
2264c4462c76230cebfb5dd94dd38a712fd8aa18 |
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 … |
david |