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

11 Коммитов

Автор SHA1 Сообщение Дата
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
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 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
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 1805dcb2d3 Bug 1436792 - [py-compat] Fix issue opening the temporary manifest on Windows, r=jmaher
MozReview-Commit-ID: FmA1K8osuqe

--HG--
extra : rebase_source : ee557c78b1c959caa10a7862fbc732b4cf11792e
2018-02-08 14:26:27 -05:00
Andrew Halberstadt 4c232ca311 Bug 1436792 - [py-compat] Improve error messaging when python is missing, r=jmaher
This patch makes a few changes around error handling:

1) Prints the name of the linter that produced non-json output
2) Changes the 'python not found' error to a warning (as this is not fatal)
3) Makes sure said warning only gets printed once (by moving it to the setup function)

MozReview-Commit-ID: Dkq7CulTs91

--HG--
extra : rebase_source : 5d4bd32a62264a88520c09420f5acd90edcdc740
2018-02-08 14:26:15 -05:00
Andrew Halberstadt a5c7e81ae6 Bug 1398765 - Fix directory exclusion bug in py-compat linters, r=gps
The excluded directories aren't being properly handled in the py2/py3 compat
linters. In order for FileFinder to apply the exclusions properly they need
to either be relative to or contained by the base.

This means that currently the following will work:
./mach lint -l py2 <topsrcdir>
./mach lint -l py2 testing/mochitest

But this is broken:
./mach lint -l py2 testing

This change fixes the compat linters so exclude paths will be made relative
to the FileFinder base before passing them in. Any exclude not contained by
the base is simply discarded as it won't be relevant to that FileFinder
instance anyway.

MozReview-Commit-ID: LJx97TvKlSa

--HG--
extra : rebase_source : b8f0cb20ec5a88a33c26ace699ed9216b070f443
2017-09-11 09:03:53 -04:00
Andrew Halberstadt 3411e8b3d4 Bug 1391019 - Add py2 and py3 compatability linters, r=gps
check_compat.py was adapted from gps' check-py3-compat.py in mercurial:
https://www.mercurial-scm.org/repo/hg/file/tip/contrib/check-py3-compat.py

The py3 linter simply runs ast.parse(f) for each file being linted. Any syntax errors
are formatted as mozlint results and dumped to stdout as json. I looked into also
importing the file (using 3.5+'s importlib.util.spec_from_file_location), but there
were too many problems:

1. Lots of false positives (e.g module not found)
2. Some files seemed to run indefinitely on import

I decided to punt on importing for now, we can always investigate in a follow-up.

The py2 linter runs ast.parse(f), and also checks that the file has:
from __future__ import absolute_import, print_function

Initially every python file in the tree is excluded from the py2 check, though
at least this makes it easy to find+fix, and new files in un-excluded
directories will automatically be linted.

MozReview-Commit-ID: ABtq9dnPo9T

--HG--
extra : rebase_source : 60762937284d498514cd020b90cbfd2ba23f0b70
2017-08-31 10:12:02 -04:00