Update JSHint for new tool support and more reliable output parsing.

Review Request #11550 — Created March 23, 2021 and submitted — Latest diff uploaded

Information

ReviewBot
release-3.0.x

Reviewers

This updates JSHintTool to subclass the newer BaseTool, and to use
the newer features it offers (dependencies, improved configurable file
extension handling, and centralized base command building, and
standardized error code/column output).

The new version of the tool also passes a custom JSHint reporter that
returns simple JSON output containing only the information we need for
reporting. This eases parsing considerably, as we can guarantee that any
of the information we use for comments will be completely accurate.

Unit tests were added to cover the new JSHint parsing, and to provide
integration tests. These currently require doing a npm install jshint
in the bot/ directory to run.

Unit tests pass on Python 2.7 and 3.x.

Manually tested the jshint tool with the custom reporter, and parsed
using that data.

There are plans to add integration tests for tools down the road, but
that will require some additional work.

Diff Revision 2

This is not the most recent revision of the diff. The latest diff is revision 3. See what's changed.

orig
1
2
3

Commits

First Last Summary ID Author
Update JSHint for new tool support and more reliable output parsing.
This updates `JSHintTool` to subclass the newer `BaseTool`, and to use the newer features it offers (dependencies, improved configurable file extension handling, and centralized base command building, and standardized error code/column output). The new version of the tool also passes a custom JSHint reporter that returns simple JSON output containing only the information we need for reporting. This eases parsing considerably, as we can guarantee that any of the information we use for comments will be completely accurate. Unit tests were added to cover the new JSHint parsing.
303747a93562394b0426c6ebda58f589c18ff1d9 Christian Hammond
bot/reviewbot/tools/jshint.py
bot/reviewbot/tools/support/js/jshint_reporter.js
bot/reviewbot/tools/tests/test_jshint.py
Loading...