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

Review Request #11558 — Created March 27, 2021 and submitted — Latest diff uploaded

Information

ReviewBot
release-3.0.x

Reviewers

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

The reporting actually parses the CodeClimate format. Flake8 supports
plugins for reporters, and one of them, flake8-json, offers
CodeClimate output. This is a format that many other tools support, so
it makes sense to use it wherever possible. A new utility function has
been added to convert these payloads into comments.

We unconditionally depend on flake8-json for the CodeClimate support,
even if flake8 itself isn't installed. This is a small dependency, and
ensures we don't need to worry about having users install yet one more
thing.

Unit tests pass on Python 2.7 and 3.x.

Diff Revision 1 (Latest)

Commits

First Last Summary ID Author
Update flake8 for new tool support and more reliable output parsing.
This updates `Flake8Tool` to subclass the newer `BaseTool`, and to use the newer features it offers (dependencies, improved centralized base command building, and standardized error code/column output). The reporting actually parses the CodeClimate format. Flake8 supports plugins for reporters, and one of them, `flake8-json`, offers CodeClimate output. This is a format that many other tools support, so it makes sense to use it wherever possible. A new utility function has been added to convert these payloads into comments. We unconditionally depend on `flake8-json` for the CodeClimate support, even if `flake8` itself isn't installed. This is a small dependency, and ensures we don't need to worry about having users install yet one more thing.
1219dfb47d38b28e2fe81d7bad5d1f26d803b020 Christian Hammond
bot/setup.py
bot/reviewbot/tools/flake8.py
bot/reviewbot/tools/tests/test_flake8.py
bot/reviewbot/tools/utils/__init__.py
bot/reviewbot/tools/utils/codeclimate.py
Loading...