Commit Graph

185 Commits

Author SHA1 Message Date
Sandor Molnar
f1b3847e69 Backed out changeset 9cef54c30d49 (bug 1648114) for causing python unit test failures in test_mach_commands. CLOSED TREE 2021-12-23 02:50:20 +02:00
Gijs Kruitbosch
a57fa13232 Bug 1648114 - make clang-tidy easier to find, r=andi
Differential Revision: https://phabricator.services.mozilla.com/D133191
2021-12-23 00:29:10 +00:00
Sylvestre Ledru
6ce7d233c4 Bug 1743088 - Mozlint: add an option to run the linter on third party code r=linter-reviewers,ahal DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D132234
2021-12-01 15:12:31 +00:00
Andrew Halberstadt
5ef76d5211 Bug 1740620 - Fix regression to 'mach lint --outgoing' on Git, r=gerard-majax
Differential Revision: https://phabricator.services.mozilla.com/D130948
2021-11-13 16:16:34 +00:00
Kagami Sascha Rosylight
bc233d2be7 Bug 1723117 - Limit max_workers value of ProcessPoolExecutor to 61 r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D121360
2021-09-03 22:27:05 +00:00
Nick Alexander
e11d5cd04e Bug 1714159 - Handle c:/... and C:/... when making relative paths in mozlint. r=ahal
Depends on D116151

Differential Revision: https://phabricator.services.mozilla.com/D116637
2021-06-02 21:27:40 +00:00
Nick Alexander
a8f3540069 Bug 1713178 - Make black linter setup avoid updating the virtualenv if it's installed. r=ahal
This could be easily generalized to avoid the updating the virtualenv
more generally, but I think this functionality should be in the
`virtualenv_manager` -- something like `install_pip_binary(...)` -- so
I've just done the most impactful example here.

Differential Revision: https://phabricator.services.mozilla.com/D116148
2021-05-31 21:44:05 +00:00
Nisarg
4b18d50091 Bug 1698838 - Create a format command as an alternative to lint --fix. r=ahal
***
Bug 1698838 - Restrict the list of linters to valid formatters r=ahal

***
Bug 1698838 - Abort formatting even if one of the linters passed is invalid r=ahal

***

***

Differential Revision: https://phabricator.services.mozilla.com/D109231
2021-04-12 18:01:14 +00:00
Cosmin Sabou
79873d0515 Bug 1703664 - Fix linting opt failure on mozlint/roller.py.
CLOSED TREE
2021-04-09 18:56:25 +03:00
Marco Castelluccio
2f5bc535f6 Bug 1703664 - Enable showing all warnings from mozlint-based linters in reviewbot. r=ahal DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D111166
2021-04-09 15:08:57 +00:00
Nisarg
3e0b107e69 Bug 1369784 - Improve the default behaviour of mozlint if no file paths or linters are specified r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D107394
2021-03-09 20:07:00 +00:00
nisarg
79603524c1 Bug 1646161 - Add command to run linters for the exclude list r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D105115
2021-03-09 20:07:00 +00:00
Akshat Dixit
ad11827401 Bug 1591991 Add lint Fixed count support to linters r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D102082
2021-02-08 19:00:10 +00:00
Akshat Dixit
43b65bee68 Bug 1646433 ./mach lint -l foobar handles the error correctly r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D102806
2021-02-04 22:04:11 +00:00
Ricky Stewart
7860c29e4c Bug 1674923 - Pass down virtualenv_manager from mach lint down to linters r=ahal
Before, on Windows, this resulted in installing the package in the parent environment (not the `virtualenv`). We fix this by passing down the `virtualenv_manager` so linters can install packages they need using that object's helper methods.

Differential Revision: https://phabricator.services.mozilla.com/D95738
2020-11-06 20:51:16 +00:00
Andrew Halberstadt
1648140b33 Bug 1673874 - [mozlint] Add some verbose logging after calling a linter's setup function, r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D95082
2020-10-28 22:02:07 +00:00
Ricky Stewart
02a7b4ebdf Bug 1654103: Standardize on Black for Python code in mozilla-central.
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-26 18:34:53 +00:00
Bogdan Tara
da1098d4aa Backed out 10 changesets (bug 1654103, bug 1672023, bug 1518999) for PanZoomControllerTest.touchEventForResult gv-junit failures CLOSED TREE
Backed out changeset ff3fb0b4a512 (bug 1672023)
Backed out changeset e7834b600201 (bug 1654103)
Backed out changeset 807893ca8069 (bug 1518999)
Backed out changeset 13e6b92440e9 (bug 1518999)
Backed out changeset 8b2ac5a6c98a (bug 1518999)
Backed out changeset 575748295752 (bug 1518999)
Backed out changeset 65f07ce7b39b (bug 1518999)
Backed out changeset 4bb80556158d (bug 1518999)
Backed out changeset 8ac8461d7bd7 (bug 1518999)
Backed out changeset e8ba13ee17f5 (bug 1518999)
2020-10-24 03:36:18 +03:00
Ricky Stewart
c0cea3b0fa Bug 1654103: Standardize on Black for Python code in mozilla-central. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-23 20:40:42 +00:00
Dorel Luca
1ff59cb7a3 Backed out changeset 7558c8821a07 (bug 1654103) for multiple failures. CLOSED TREE 2020-10-22 03:51:06 +03:00
Ricky Stewart
50762dacab Bug 1654103: Standardize on Black for Python code in mozilla-central. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-21 21:27:27 +00:00
Andrew Halberstadt
bc270b20f5 Bug 1657604 - [mozlint] Support multiple linters per yaml file, r=linter-reviewers,sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D86206
2020-08-07 07:12:41 +00:00
Tom Prince
97a298b135 Bug 1652503: [mozlint] Use attrs for mozlint.result.Issue; r=ahal
This gives sorting on `Issue` for free, which makes it easier to write tests
for linters.

Differential Revision: https://phabricator.services.mozilla.com/D84643
2020-07-23 14:55:45 +00:00
Sylvestre Ledru
56fbafd822 Bug 1647265 - mozlint: when type is 'regex', add the capability to ignore the case r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D80477
2020-06-23 21:45:16 +00:00
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