Граф коммитов

144 Коммитов

Автор SHA1 Сообщение Дата
Bastien Abadie 8a92639faf Bug 1609116 - Activate warnings for rustfmt on code review mode, r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D59859

--HG--
extra : moz-landing-system : lando
2020-01-17 08:05:40 +00:00
Andrew Halberstadt e9029a6b3a Bug 1608535 - [mozlint] Add an option to specify the number of processes to spawn, r=Standard8
This is a ride-along commit that would have made debugging the problem solved
by this bug easier.

Depends on D60688

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

--HG--
extra : moz-landing-system : lando
2020-01-23 13:31:44 +00:00
Andrew Halberstadt 0f4437d7d5 Bug 1608783 - [mozlint] Fix bug in 'collapse' when two paths are a prefix of one another, r=Standard8
This was happening because we had two exclude paths that were run through the 'collapse' algorithm:
editor/libeditor/tests/browserscope/lib/richtext
editor/libeditor/tests/browserscope/lib/richtext2

The problem was that in order to determine the base directory, the algorithm called
'os.path.commonprefix'. This function just returns the common string prefix, which
is the '.../lib/richtext' path. Even though in the above, the base *should* have
been '.../lib'.

To fix the problem, we add a check to ensure the computed base doesn't have any
sibling directories with the same prefix. If there are, it means 'commonprefix' was
too greedy.

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

--HG--
extra : moz-landing-system : lando
2020-01-17 16:18:59 +00:00
Philip Jägenstedt 21b473eac4 Bug 1589056 - [mozlog] Update mozlog version number to 5.0 r=jgraham
This is needed to release a new mozlog with the PRECONDITION_FAILED
test and subtest status for use in web-platform-tests.

Update all in-tree dependencies on mozlog to >=5.0. These were found
with `hg grep 'mozlog.*[0-9]'`.

Only testing/web-platform/tests/tools/wptrunner/requirements.txt
remains on 4.2.0, and it will be updated in upstream wpt after mozlog
5.0 has been released.

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

--HG--
extra : moz-landing-system : lando
2019-10-24 14:12:32 +00:00
Andrew Halberstadt ae2f34a5b1 Bug 1585686 - [mozlint] Avoid UnicodeEncodeError for users who have an 'ascii' locale r=gbrown
Differential Revision: https://phabricator.services.mozilla.com/D47941

--HG--
extra : moz-landing-system : lando
2019-10-03 13:17:08 +00:00
Andrew Halberstadt d3eae4b83c Bug 1580280 - [mozlint] Run |mach lint| with Python 3 and drop support for Python 2 r=mars
Differential Revision: https://phabricator.services.mozilla.com/D45441

--HG--
extra : moz-landing-system : lando
2019-09-30 15:09:41 +00:00
Oana Pop Rus 4b9792db7c Backed out changeset 371641b1010b (bug 1580280) for lints failure on a CLOSED TREE 2019-09-26 00:18:33 +03:00
Andrew Halberstadt fdc7d0afac Bug 1580280 - [mozlint] Run |mach lint| with Python 3 and drop support for Python 2 r=mars
Differential Revision: https://phabricator.services.mozilla.com/D45441

--HG--
extra : moz-landing-system : lando
2019-09-25 20:03:14 +00:00
Anmol Agarwal d6766388f1 Bug 1554657 - Add a verbose mode to |mach lint| to display log output r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D43507

--HG--
extra : moz-landing-system : lando
2019-09-23 13:19:25 +00:00
Andrew Halberstadt 5b5dc5542a Bug 1580280 - [lint] Support Python 3 in the flake8 integration r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D45436

--HG--
extra : moz-landing-system : lando
2019-09-11 10:00:58 +00:00
Andrew Halberstadt e6e5e7b6fa Bug 1580280 - [mozlint] Support Python 3 in the mozlint library r=egao
Differential Revision: https://phabricator.services.mozilla.com/D45435

--HG--
extra : moz-landing-system : lando
2019-09-11 15:07:29 +00:00
Nick Alexander f049bde942 Bug 1512487 - Part 2: Add "global" lint type. r=ahal
This patch adds a global lint that only runs when a file or directory
that matches their configuration (via `extensions` and `exclude`) has
been modified or specified.

Global lints never shard into chunks; they are, by definition global
(i.e., across the entire source tree) and act on all inputs in a
single invocation.  It's up to the global lint to manage command line
sizes, etc.  Since batching is handled by the lint type but sharding
is handled by the lint roller, there's a little abstraction leak so
that the lint type can control how its invocation is sharded: the
existing `batch` member is generalized from the existing `True` and
`False` to add a new `"global"` value which disables sharding.

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

--HG--
extra : moz-landing-system : lando
2019-08-02 20:34:09 +00:00
Nick Alexander fd38e457ec Bug 1512487 - Part 1: Allow lints to inspect part of the build environment. r=ahal
This allows lints to "condition" themselves on having a build
environment or a specific build application.  It also adds the "name"
parameter, so that setup functions can be shared across lints.

`MozbuildObject` cannot be used as parameters to functions distributed
via multiprocessing, since they cannot be pickled (due, currently, to
internal terminal handles).  Therefore we extract just a few key
parts of the environment to expose.

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

--HG--
extra : moz-landing-system : lando
2019-08-02 20:30:02 +00:00
Bastien Abadie 74eca00f1f Bug 1569882 - Fix mozlint unit tests for relative path outputs, r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D39877

--HG--
extra : moz-landing-system : lando
2019-07-30 23:30:15 +00:00
Bastien Abadie 11ff2f61f3 Bug 1568484 - Output issues relative paths in mozlint, r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D39162

--HG--
extra : moz-landing-system : lando
2019-07-26 15:39:17 +00:00
Sylvestre Ledru 6446b8a5f0 Bug 1552897 - Ride along: format with black r=ahal
Depends on D31807

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

--HG--
extra : moz-landing-system : lando
2019-05-23 16:44:04 +00:00
Robert Bartlensky d56df326cf Bug 1552897 - Add support of diff in stylish/mozlint results r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D31807

--HG--
extra : moz-landing-system : lando
2019-05-23 16:42:46 +00:00
Bastien Abadie 9b8eb1ef99 Bug 1536836 - Support multiple formatters with file output in ./mach lint, r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D24193

--HG--
extra : moz-landing-system : lando
2019-03-25 09:16:14 +00:00
Andrew Halberstadt aac57cc8b5 Bug 1533152 - [flake8] Make sure glob patterns are honoured when passing files directly, r=andi
Flake8 ignores the 'exclude' section of the .flake8.yml if you pass in a direct
path to a file. To get around this we have some custom logic to handle these
exclusions for us, but this custom logic didn't account for globs.

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

--HG--
extra : moz-landing-system : lando
2019-03-12 15:08:41 +00:00
Axel Hecht e659d85fed Bug 1530352, add lintargs to lint setup, r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D21010

--HG--
extra : moz-landing-system : lando
2019-03-05 16:15:03 +00:00
Andrew Halberstadt db9e1a5ab1 Bug 1367092 - [flake8] Take exclusion handling away from flake8, r=egao
The motivations for this are:

1) Apply global excludes. This merges the exclusion rules defined in
tools/lint/mach_commands.py with the ones in .flake8.

2) Improve performance. Switching to a blacklist will result in a much longer
runtime for linting the entire tree and flake8 handles exclusions incredibly
slowly. Without this patch (and the blacklist change applied), I gave up
waiting after 30 minutes. With this patch, it takes 30 seconds.

Depends on D20495

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

--HG--
rename : tools/lint/test/files/flake8/bad.py => tools/lint/test/files/flake8/subdir/exclude/bad.py
extra : moz-landing-system : lando
2019-02-22 22:16:57 +00:00
Andrew Halberstadt 2152caf120 Bug 1367092 - [lint] Move py2/py3 linter's exludes logic into mozlint, r=egao
This will be re-used by the flake8 linter, so moving it into mozlint for
re-useability.

Depends on D20493

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

--HG--
extra : moz-landing-system : lando
2019-02-22 21:18:22 +00:00
Justin Wood bf9836a1bb Bug 1524444 - Respect -n for linting in py3/py2 and better support it in other linters. r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D6847

--HG--
extra : moz-landing-system : lando
2019-02-01 20:39:05 +00:00
Andrew Halberstadt ce87b08ac4 Bug 1436037 - [python] Create Windows python-test tasks, r=gps
The following python-test paths are being moved out of 'make check' and into their own task:
- python/mozlint
- testing/mozbase
- tools/lint

The following python-test paths previously did not run on Windows:
- python/mozterm
- testing/marionette
- testing/raptor
- tools/tryselect

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

--HG--
extra : moz-landing-system : lando
2018-12-05 19:20:16 +00:00
Andreea Pavel e3299fd2db Backed out 5 changesets (bug 1498640, bug 1436037, bug 1497660, bug 1505579) for mass failures on a CLOSED TREE
Backed out changeset 914a7a899dd1 (bug 1436037)
Backed out changeset e072757bf691 (bug 1436037)
Backed out changeset b0805a8cf6eb (bug 1505579)
Backed out changeset aa32ba9e6df3 (bug 1498640)
Backed out changeset ce441b8a784c (bug 1497660)
2018-11-15 07:53:41 +02:00
Andrew Halberstadt b03e2aa337 Bug 1436037 - [python] Create Windows python-test tasks, r=gps
The following python-test paths are being moved out of 'make check' and into their own task:
- python/mozlint
- testing/mozbase
- tools/lint

The following python-test paths previously did not run on Windows:
- python/mozterm
- testing/marionette
- testing/raptor
- tools/tryselect

MozReview-Commit-ID: C07FANaYzf7

Depends on D10758

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

--HG--
extra : moz-landing-system : lando
2018-11-15 00:49:45 +00:00
Andrew Halberstadt 971c025237 Bug 1503599 - [mozlint] Default lineno to 0 in result.Issue if unset, r=jgraham
This assumes that a lineno of 0 denotes a "file-level" issue, e.g an issue
associated with the filename. In the future it might be better to treat these
"file-level" issues as first class citizens. This would involve updating things
like formatters, editor integrations and review bot to not assume a lineno.

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

--HG--
extra : moz-landing-system : lando
2018-11-07 15:21:31 +00:00
Andrew Halberstadt 27d8b8ee2d Bug 1500447 - [mozlint] Make sure lineno and column are always int (if present), r=rwood
This also updates the test for string inputs.

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

--HG--
extra : moz-landing-system : lando
2018-10-19 15:54:32 +00:00
Andrew Halberstadt 8dbaa4117c Bug 1375861 - [mozlint] Globally exclude paths listed in tools/rewriting/ThirdPartyPaths.txt from our linters, r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D9126

--HG--
extra : moz-landing-system : lando
2018-10-18 15:27:59 +00:00
Andrew Halberstadt bb07ea7442 Bug 1499510 - [mozlint] Fix regression to |mach lint --edit| when using vim, r=egao
Differential Revision: https://phabricator.services.mozilla.com/D8905

--HG--
extra : moz-landing-system : lando
2018-10-17 20:19:37 +00:00
Andrew Halberstadt 1f22f2329e Bug 1494069 - [mozlint] Make sure exclude paths always get discarded when necessary, r=rwood
We were currently adding exclude paths to the "discard" set if the path contains
the include, but we weren't adding them if the include contains the path.

Depends on D5863

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

--HG--
extra : moz-landing-system : lando
2018-10-16 21:04:14 +00:00
Andrew Halberstadt 80db4d8fe5 Bug 1494069 - [mozlint] Verify the expected_exclude paths in test_filterpaths, r=rwood
Depends on D8844

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

--HG--
extra : moz-landing-system : lando
2018-10-16 21:04:15 +00:00
Andrew Halberstadt bd652813d6 Bug 1494069 - [mozlint] Append global 'excludes' to each linter at parse time, r=rwood
Right now there are excludes defined in the linter definition (via the .yml
files), as well as excludes defined in lintargs (via the mach_commands.py).

This is a minor simplification that extends each linter definition's local
excludes with the global ones right off the bat. This just makes it a bit
easier to keep track of.

Depends on D5863

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

--HG--
extra : moz-landing-system : lando
2018-10-16 21:04:14 +00:00
Andrew Halberstadt 11b55db4b1 Bug 1494069 - [mozlint] Return extra 'excludes' directly from pathutils.filterpaths, r=rwood
Currently pathutils.filterpaths computes some extra paths that the underlying linter
should try to exclude if it can. It sets these on lintargs['exclude'], and relies on
the fact that it was passed by reference to work.

However, it seems like pytest does some magic under the hood that prevents this value
from being propagated back. It will also fail if 'filterpaths' was invoked in a
subprocess.

It's much simpler and cleaner to pass this value back directly, rather than rely on a
reference.

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

--HG--
extra : moz-landing-system : lando
2018-10-16 21:04:15 +00:00
Andrew Halberstadt fc52a253be Bug 1494069 - [mozlint] Properly exclude files in LineType linters, r=rwood
This fixes a latent bug that is currently not being hit (by sheer luck). Basically
the 'ignore' argument of a FileFinder object needs all paths to be relative to the
base. As luck would have it, most of the time it worked out that way if you were
running |mach lint| from the root of the repo.

However there are edge cases where this will cause an 'exclude' directive to get
missed. Plus this bug is about to be exposed 100% of the time in the next commit :).

Depends on D8842

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

--HG--
extra : moz-landing-system : lando
2018-10-16 21:04:14 +00:00
Andrew Halberstadt 1042a9f445 Bug 1494069 - [mozlint] Fix edge case in pathutils.collapse, r=rwood
I missed an edge case where the computed base itself was specified in the
paths input.

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

--HG--
extra : moz-landing-system : lando
2018-10-17 13:52:21 +00:00
Andrew Halberstadt f4c851912d Bug 1494069 - [mozlint] Collapse exclude paths into their smallest possible set, r=egao
Often we specify globs in our exclude patterns, e.g:

    exclude:
        - **/node_modules
        - obj*

However, these globs get expanded out to *every* file that matches them. This
can sometimes be thousands or even tens of thousands of files.

We then pass these paths on to the underlying linters and tell them to
exclude them all. This causes a lot of overhead and slows down performance.

This commit implements a "collapse" function. Given a set of paths, it'll
collapse them into the smallest set of parent directories that contain the
original set, and that don't contain any extra files.

For example, given a directory structure like this:

    a
    -- foo.txt
    -- b
       -- bar.txt
       -- baz.txt
    -- c
       -- ham.txt
       -- d
          -- spam.txt

Then the following will happen:

     >>> collapse(['a/foo.txt', 'a/b/bar.txt', 'a/c/ham.txt', 'a/c/d/spam.txt'])
     ['a/foo.txt', 'b/bar.txt', 'c']

Since all files under directory 'c' are specified by the original set (both
'c/ham.txt' and 'c/d/spam.txt'), we can collapse it down to just 'c'. However
not all files under 'b' are specified (we're missing 'a/b/baz.txt'), so we
can't collapse 'b' (and by extension also can't collapse 'a').

If we had included 'a/b/baz.txt':

     >>> collapse(['a/foo.txt', 'a/b/bar.txt', 'a/b/baz.txt', 'a/c/ham.txt', 'a/c/d/spam.txt'])
     ['a']

In both cases, the smallest set of paths that contains the original set (and
only the original set) is computed.

The collapse function has a little bit of overhead but it's not too bad.
For example collapsing all files matched by '**/node_modules' takes ~0.015s.
Collapsing two full objdirs, takes ~0.6s. But a follow up commit is planned to
make sure we stop using 'obj*' to reduce that overhead.

Depends on D7738

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

--HG--
extra : moz-landing-system : lando
2018-10-12 15:57:42 +00:00
Csoregi Natalia f00a0ea9cc Backed out 3 changesets (bug 1494069) for blocking 1498215. a=backout
Backed out changeset 9752f179b9c3 (bug 1494069)
Backed out changeset fe0fb280dbfc (bug 1494069)
Backed out changeset a2956764213e (bug 1494069)
2018-10-12 13:11:04 +03:00
Narcis Beleuzu e8f62dbf84 Backed out changeset b01876f4f16e (bug 1498215) for bustages on test_pathutils.py. CLOSED TREE 2018-10-11 23:56:45 +03:00
James Graham 766c447843 Bug 1498215 - Fix problem importing scandir when system scandir exists, r=davehunt
If scandir is already present on the system the attempt to import the
c helper library will currently find the c helper from the system
install which may well be an outdated verion, so causing mach to
break. To solve this this patch does two things:

* Stops importing scandir in files that are run unconditionally when
  invoking mach. This is generally considered good for performance
  reasons.

* Installs the vendored scandir into the virtualenv for `mach lint`
  rather than trying to import it directly from the source tree and so
  not getting the c helper library.

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

--HG--
extra : moz-landing-system : lando
2018-10-11 15:05:16 +00:00
Andrew Halberstadt 83df36524d Bug 1494069 - [mozlint] Collapse exclude paths into their smallest possible set, r=egao
Often we specify globs in our exclude patterns, e.g:

    exclude:
        - **/node_modules
        - obj*

However, these globs get expanded out to *every* file that matches them. This
can sometimes be thousands or even tens of thousands of files.

We then pass these paths on to the underlying linters and tell them to
exclude them all. This causes a lot of overhead and slows down performance.

This commit implements a "collapse" function. Given a set of paths, it'll
collapse them into the smallest set of parent directories that contain the
original set, and that don't contain any extra files.

For example, given a directory structure like this:

    a
    -- foo.txt
    -- b
       -- bar.txt
       -- baz.txt
    -- c
       -- ham.txt
       -- d
          -- spam.txt

Then the following will happen:

     >>> collapse(['a/foo.txt', 'a/b/bar.txt', 'a/c/ham.txt', 'a/c/d/spam.txt'])
     ['a/foo.txt', 'b/bar.txt', 'c']

Since all files under directory 'c' are specified by the original set (both
'c/ham.txt' and 'c/d/spam.txt'), we can collapse it down to just 'c'. However
not all files under 'b' are specified (we're missing 'a/b/baz.txt'), so we
can't collapse 'b' (and by extension also can't collapse 'a').

If we had included 'a/b/baz.txt':

     >>> collapse(['a/foo.txt', 'a/b/bar.txt', 'a/b/baz.txt', 'a/c/ham.txt', 'a/c/d/spam.txt'])
     ['a']

In both cases, the smallest set of paths that contains the original set (and
only the original set) is computed.

The collapse function has a little bit of overhead but it's not too bad.
For example collapsing all files matched by '**/node_modules' takes ~0.015s.
Collapsing two full objdirs, takes ~0.6s. But a follow up commit is planned to
make sure we stop using 'obj*' to reduce that overhead.

Depends on D7738

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

--HG--
extra : moz-landing-system : lando
2018-10-09 19:26:23 +00:00
Andrew Halberstadt 9d5e499a90 Bug 1448417 - [mozlint] Remove ability to specify globs in an 'include' directive, r=egao
There is only a single linter (test-disable.yml) that uses a glob in any
include path, and that usage is easily replaced by using the 'extensions' key
instead.

Since globs in include directives aren't very useful, let's disallow them. This
will allow us to simplify the 'filterpaths' logic quite substantially and make
future refactorings in this area easier.

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

--HG--
extra : moz-landing-system : lando
2018-09-25 18:30:23 +00:00
Andrew Halberstadt 2aba2689ec Bug 1448417 - [mozlint] Be explicit about which linters are used for functions in test_roller.py, r=rwood
This makes things more explicit. Previously we were relying on those magic
global "linters" variables, and it turned out that one of the tests was
actually linting a completely different set of linters than I was expecting.

This changes things so each test needs to explicitly define which linters it
wants to use.

Depends on D6410

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

--HG--
extra : moz-landing-system : lando
2018-09-20 20:45:04 +00:00
Andrew Halberstadt a7af481576 Bug 1448417 - [mozlint] Rename test_filterpaths.py to test_pathutils.py, r=rwood
This makes this test match all the other tests (which are named after the module
they are testing).

Also rename the test function to 'test_filterpaths'.

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

--HG--
rename : python/mozlint/test/test_filterpaths.py => python/mozlint/test/test_pathutils.py
extra : moz-landing-system : lando
2018-09-20 20:27:45 +00:00
Andrew Halberstadt 3d4150df71 Bug 1486866 - [mozlint] Refactor test_include_exclude into parametrized test cases, r=egao
This will make it easier to add new test cases in the future. It'll
also make it easier to print debug, as only the output for each
specific test case will be printed on failure.

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

--HG--
extra : moz-landing-system : lando
2018-09-17 15:36:35 +00:00
Andrew Halberstadt 921c895df2 Bug 1487425 - [mozlint] Fix regression where 'roll' returns dict instead of ResultSummary when no files linted, r=Gijs
This is a regression from bug 1460856.

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

--HG--
extra : moz-landing-system : lando
2018-08-31 16:05:12 +00:00
Andrew Halberstadt 244690e1b9 Bug 1485454 - [mozlint] Fix stylish formatter, issues without a column aren't indented enough, r=sylvestre
After fixing the absolute path issue in codespell, I noticed that the stylish
formatter doesn't indent lint issues that don't have a column properly. This
was never noticed before since most other linters have a column attribute.

Depends on D4012

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

--HG--
extra : moz-landing-system : lando
2018-08-27 13:40:34 +00:00
Andrew Halberstadt c9cfb100eb Bug 1460856 - [mozlint] Display suppressed warnings count in the summary and stylish formatters r=Standard8
Depends on D3821

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

--HG--
extra : moz-landing-system : lando
2018-08-27 13:37:28 +00:00
Andrew Halberstadt 787fff6a51 Bug 1460856 - [mozlint] Suppress warnings by default r=Standard8,sylvestre
As of this patch, any lint issue at the "warning" level will *only* be displayed
if --warnings is passed in. This gives us some flexibility to track issues that
are "recommended to fix" but that aren't required (aka don't cause a backout).
I think it would be ideal if the reviewbot ran with warnings enabled, and CI
ran without warnings. This way these issues will be surfaced to developers
(and hopefully get fixed prior to landing), but developers will always be able
to ignore them if the situation warrants it.

Since the last change converted everything to use errors, this patch should
be a no-op for now. However as we move forward (and potentially decide that
certain types of lint issues should result in a backout), this feature will
start seeing more and more use.

Depends on D3820

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

--HG--
extra : moz-landing-system : lando
2018-08-27 13:39:46 +00:00
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