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

161 Коммитов

Автор SHA1 Сообщение Дата
Rob Lemley 3b393ab7ea Bug 1626104 - Change mach lint --config-path to be relative to topsrcdir. r=linter-reviewers,ahal
This makes the --config-path option relative to topsrcdir rather then the current
directory.
Using a relative path is difficult for a developer running mach lint locally as
the command has to change as the working directory changes. A stable base path also
facilitates creating an alias in machrc.

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

--HG--
extra : moz-landing-system : lando
2020-03-31 19:41:22 +00:00
Steve Fink 86ca4b5374 Bug 1621322 - Implement `mach lint --revset=REV` r=ahal
In the process, fixed a few bugs:
 - the template eg `{file_adds % "\n{file}"}` produced a leading blank line,
   which led to everything being linted.
 - 'd' was replaced with 'r' in diff_filters, but the replacement was discarded.
 - as a result of the above, `hg status -d` was being used ("show only deleted (but tracked) files") and now it is `hg status -r` ("show only removed files"). I *think* this is what was intended?

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

--HG--
extra : moz-landing-system : lando
2020-03-22 22:12:18 +00:00
Sylvestre Ledru 7cfa120eb9 Bug 1623320 - Add support to run mozlint on dotfile r=linter-reviewers,ahal
Differential Revision: https://phabricator.services.mozilla.com/D67316

--HG--
extra : moz-landing-system : lando
2020-03-20 21:51:03 +00:00
Rob Lemley c7061b9ab3 Bug 1622974 - Add mozlint parameter to set additional config file path. r=ahal
Adds --config-paths parameter to mach mozlint where test configuration
files (.yml) can be located. The default path "tools/lint" is set automatically
and additional paths have preference over the default.
This allows Thunderbird to run mozlint-based tests in Taskcluster with a
different configuration.

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

--HG--
extra : moz-landing-system : lando
2020-03-20 17:12:27 +00:00
Andrew Halberstadt 3315f2c93c Bug 1623433 - [mozlint] Create a LintProcess utility class to consolidate some of our lint implementations, r=linter-reviewers,sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D67410

--HG--
extra : moz-landing-system : lando
2020-03-19 14:47:34 +00:00
Andrew Halberstadt c568660c37 Bug 1570654 - [mozlint] Filter out non-existent paths in filterpaths, r=linter-reviewers,sylvestre
While we validate user specified paths early and only consider the 'AM' (added
+ modified) diff filter from versioncontrol, it's still possible to get
non-existent files when using --outgoing. This situation can happen when you
have a commit series that first modifies a file in an earlier commit, and then
moves/deletes it in a later commit.

To get around this, just silently filter out any file paths that don't exist.

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

--HG--
extra : moz-landing-system : lando
2020-03-19 18:06:41 +00:00
Andrew Halberstadt ed55b7f24b Bug 1623656 - [mozlint] Make output of ./mach lint --list readable, r=linter-reviewers,sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D67501

--HG--
extra : moz-landing-system : lando
2020-03-19 18:06:41 +00:00
Andrew Halberstadt 5712219535 Bug 1623339 - [mozlint] Add a test for pathutils.expand_exclusions, r=linter-reviewers,sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D67334

--HG--
extra : moz-landing-system : lando
2020-03-18 17:02:27 +00:00
Geoff Brown dc64cf08e6 Bug 1619586 - Major version bump for mozlog and mozcrash; r=bc,marionette-reviewers,perftest-reviewers,jgraham,whimboo
Major version number bump for both mozlog and mozcrash + requirements update.
This is very much like the previous mozlog major bump - see bug 1591384.
This patch does not update testing/web-platform/tests/tools/wptrunner/requirements.txt;
I expect that will be automatically updated by the pyup.io bot once mozlog is re-released.

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

--HG--
extra : moz-landing-system : lando
2020-03-04 00:32:38 +00:00
Mark Banner 58ef4b8178 Bug 1612077 - Use parallel directory processing for Lint when no path is specified or a support file is touched. r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D61219

--HG--
extra : moz-landing-system : lando
2020-03-02 21:51:58 +00:00
Narcis Beleuzu 0543d20741 Backed out changeset 8b2c3a0fa051 (bug 1612077) lint failures on test_support_files.py. CLOSED TREE 2020-03-02 19:38:08 +02:00
Mark Banner 02ccafc74c Bug 1612077 - Use parallel directory processing for Lint when no path is specified or a support file is touched. r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D61219

--HG--
extra : moz-landing-system : lando
2020-03-02 15:02:23 +00:00
Mihai Alexandru Michis 45d339f5d6 Backed out changeset 9b60a11f4550 (bug 1612077) for causing failures in mozlint/test/test_roller.py 2020-02-28 16:18:12 +02:00
Mark Banner 4948a30dbf Bug 1612077 - Use parallel directory processing for Lint when no path is specified or a support file is touched. r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D61219

--HG--
extra : moz-landing-system : lando
2020-01-31 12:45:12 +00:00
Andrew Halberstadt 8f84b09e44 Bug 1612115 - [mozlint] Fix an error in the path filtering logic, r=linter-reviewers,sylvestre CLOSED TREE
Essentially:

  FilterPath("docs").contains("docshell")

was returning True because "docshell" startswith "docs".

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

--HG--
extra : source : 10f69335c6f5779522b16c3376fc78147e4a3ce0
extra : histedit_source : 7577a814e2cdf6168cd88460c42e4472dfb8f734
2020-02-27 21:52:50 +00:00
shindli d56d4b53db Backed out 2 changesets (bug 1612115) for causing a mozlint failure in /builds/worker/checkouts/gecko/tools/lint/test/test_yaml.py CLOSED TREE
Backed out changeset 8b3bb998c3c2 (bug 1612115)
Backed out changeset 10f69335c6f5 (bug 1612115)
2020-02-28 00:07:04 +02:00
Andrew Halberstadt bec168857b Bug 1612115 - [mozlint] Fix an error in the path filtering logic, r=linter-reviewers,sylvestre
Essentially:

  FilterPath("docs").contains("docshell")

was returning True because "docshell" startswith "docs".

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

--HG--
extra : moz-landing-system : lando
2020-02-27 21:52:50 +00:00
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