gecko-dev/python/mozlint
Andrew Halberstadt bbd3ba0a18 Bug 1460856 - [mozlint] Encapsulate all result state in a ResultSummary class r=sylvestre
Currently there are 3 things that can impact the result of a lint run:

1. The list of lint issues found
2. The set of failures that happened during the setup phase
3. The set of failures that happened during the execution phase

All three of these things are stored as instance variables on the LintRoller
object, and then passed into a formatter when it comes time to print the
results. I'd like to add even more things that can impact the result, and it
became clear that the current scenario does not scale well.

This patch moves all data that could impact the end result of a lint run off of
the LintRoller object and onto a new 'result.ResultSummary' class. To avoid
confusion, this patch also renames the 'result.ResultContainer' class to
'result.Issue'.

With this new nomenclature:

result  -> overall state of an entire lint run (can comprise multiple linters)
issue   -> one specific lint infraction (at either 'warning' or 'error' level)
failure -> a non-recoverable error in the linter implementation itself

A "result" is comprised of 0 or more "issues" and 0 or more "failures".

Differential Revision: https://phabricator.services.mozilla.com/D3819

--HG--
extra : moz-landing-system : lando
2018-08-28 13:51:04 +00:00
..
mozlint Bug 1460856 - [mozlint] Encapsulate all result state in a ResultSummary class r=sylvestre 2018-08-28 13:51:04 +00:00
test Bug 1460856 - [mozlint] Encapsulate all result state in a ResultSummary class r=sylvestre 2018-08-28 13:51:04 +00:00
setup.py Bug 1397423 - Enable py2 linter on python/mozlint. r=ahal 2017-09-06 22:52:46 -04:00