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

20 Коммитов

Автор SHA1 Сообщение Дата
Wes Kocher 765926408d Backed out changeset e1d144423657 (bug 1280571) for making leaks hard to diagnose a=backout CLOSED TREE 2016-09-21 16:56:50 -07:00
Prabhjyot Singh Sodhi 58b6130e52 Bug 1280571 - Add testing/mochitest to the flake8 linter, r=ahal
This also adds E402 (no imports at top of file) to the global ignore list. The
other error codes added were previously ignored by default, but now that we
have started a custom ignore list, need to be listed explicitly.

MozReview-Commit-ID: RtMuVEX6i5

--HG--
extra : rebase_source : 939bc9354f5891c680513d7e9068d0438e169132
2016-09-21 08:49:46 -04:00
Bryce Van Dyk 00c9132cb6 Bug 1303646 - Escape backslashes when processing flake8 output. r=ahal
During process_line each line is loaded into JSON. As it stands it is possible
to attempt loads on lines containing single backslashes. This will fail the
load as these characters are invalid in JSON. This is particularly noticeable on
Windows, where all paths will contain these characters.

This changeset escapes any back slashes in the lines. It also adds logging to
the error case for the JSON loading, so failures aren't silently swallowed.

***
Fix issues brought up in review, silly mistakes in last changeset.

- Update log message upon encountering non JSON linter output that cannot be
  handled by json.loads.
- Correct typo: formate -> format.
- Correct replace string. Was using r'\\\\', which will evaluate to 3 slashes,
  now using '\\\\', which evaluates to 2. Opting not to use a raw string here
  because of the confusion over the final backslash interaction (final one still
  needs to be escaped even in a raw string).

MozReview-Commit-ID: Hfa0jSdnege

--HG--
extra : rebase_source : bd29d2437cf61f01df6d01a70ed651b49e33656e
2016-09-20 08:41:09 +12:00
Henrik Skupin a5a7c13571 Bug 1300776 - Add testing/marionette/harness to flake8 linter (except mixins, tests) . r=ahal
MozReview-Commit-ID: F9Hfze9zvzE

--HG--
extra : rebase_source : ddd2e63bf13967da1d66d49cbdd189b68e0e7402
2016-09-06 15:46:08 +02:00
Andrew Halberstadt ed73940aa9 Bug 1288425 - Make sure we skip invalid extensions when linting with --rev or --workdir, r=smacleod
Some linters, such as flake8, will lint invalid file extensions if you explicitly pass them in. E.g,
|flake8 foobar.js| will result in flake8 attempting to lint a JS file. This is a problem because passing
in files explicitly is exactly what the --rev/--workdir options do. If a developer modifies a JS file
then runs |mach lint -l flake8 -w|, that JS file will get linted.

To prevent this, mozlint needs to handle file extensions instead of relying on the underlying linter to
do it. This patch adds an "extensions" config option to the LINTER dict, and will filter these files out
as part of the 'filterpaths' steps.

MozReview-Commit-ID: KYhC6SEySC3

--HG--
extra : rebase_source : 6fea2942b2db1bea7deca1d6738546362b6ebd65
2016-08-09 16:24:04 -04:00
Andrew Halberstadt 5353a06823 Bug 1289805 - Don't pass in --exclude to flake8 paths that contain custom configuration, r=smacleod
This fixes a bug in flake8, where if you pass in --exclude to a path with a custom .flake8 file, that
configuration will be ignored. I'm not sure why this happens.

Prior to this commit series, the 'exclude' paths weren't being passed on to the flake8 linter properly.
This is why the problems hasn't surfaced until now. This is a band-aid fix until a proper (likely
upstream) fix can be landed.

MozReview-Commit-ID: KYhC6SEySC3

--HG--
extra : rebase_source : 0dbf30dcb17c37787c2ddebbb3c7de5f3b63860b
2016-08-09 16:28:13 -04:00
Piyush Sinha 7e1a93b672 Bug 1274167 - Add Linter(flake8) support for Firefox-ui and Puppeteer.r=whimboo
MozReview-Commit-ID: Ga3iaEH54yH

--HG--
extra : rebase_source : 264c275f6e4bf8feaa2a65479aba43ca1e2cd27e
2016-08-15 02:16:18 +05:30
Iris Hsiao bb2d612158 Backed out changeset 2141360b4137 (bug 1288425) for build bustage 2016-07-27 10:59:10 +08:00
Andrew Halberstadt 18f9c226a5 Bug 1288425 - Make sure we skip invalid extensions when linting with --rev or --workdir, r=smacleod
Some linters, such as flake8, will lint invalid file extensions if you explicitly pass them in. E.g,
|flake8 foobar.js| will result in flake8 attempting to lint a JS file. This is a problem because passing
in files explicitly is exactly what the --rev/--workdir options do. If a developer modifies a JS file
then runs |mach lint -l flake8 -w|, that JS file will get linted.

To prevent this, mozlint needs to handle file extensions instead of relying on the underlying linter to
do it. This patch adds an "extensions" config option to the LINTER dict, and will filter these files out
as part of the 'filterpaths' steps.

MozReview-Commit-ID: KYhC6SEySC3

--HG--
extra : rebase_source : 46807a4913660f33e691b864c2c59c448902dfa5
2016-07-19 13:50:25 -04:00
Tom Tromey 5538d692d3 Bug 1286877 - do not set c-basic-offset for python-mode; r=gps
This removes the unnecessary setting of c-basic-offset from all
python-mode files.

This was automatically generated using

    perl -pi -e 's/; *c-basic-offset: *[0-9]+//'

... on the affected files.

The bulk of these files are moz.build files but there a few others as
well.

MozReview-Commit-ID: 2pPf3DEiZqx

--HG--
extra : rebase_source : 0a7dcac80b924174a2c429b093791148ea6ac204
2016-07-14 10:16:42 -06:00
malayaleecoder a39c5a1a22 Bug 1283044 - Fix all flake8 error in testing/talos for python3. r=jmaher 2016-07-01 21:18:07 +05:30
malayaleecoder 3317aafa12 Bug 1277490 - add flake8 linter support to talos r=jmaher
MozReview-Commit-ID: Erijz8ywllA
2016-06-28 13:32:11 +05:30
Justin Wood 15b23fced1 Bug 1280956 - Use in-tree linter job to flake8 test taskcluster directory. r=dustin
MozReview-Commit-ID: FsWmAnnycZ2

--HG--
extra : rebase_source : 04a32cea2de133cb75472092cffb8a215f7dc603
2016-06-20 21:06:55 -04:00
Andrew Halberstadt 7c3487a2d7 Bug 1277851 - [mozlint] Run flake8 directories that contain a .flake8 file separately, r=maja_zf
This is a crude workaround to get subdirectory .flake8 files working. Hopefully
this is temporary until flake8 3.0 is released with support for multiple config
files.

Note that .flake8 files that live outside of a directory that is explicitly
listed in the 'include' directive, will not be considered.

MozReview-Commit-ID: GtpUZHJKq52

--HG--
extra : rebase_source : 0294e135673a3b580316a46ec13e37749422edba
2016-06-03 10:39:32 -04:00
David Burns c99cc3f3c1 Bug 1277672: Add Marionette Client to included directories for linting. r=ahal
MozReview-Commit-ID: 58sHBjqHpxV

--HG--
extra : rebase_source : c60b6b545551f5b567b7abc9a17e85e993b792ea
2016-06-02 21:25:24 +01:00
Andrew Halberstadt 031698ae90 Bug 1273634 - [mozlint] Add a treeherder formatter, r=jgraham
This is a really simple and ugly formatter that is compatible with
treeherder's error highlighting mechanism. It is designed to be identical
to the current eslint output on treeherder:
https://dxr.mozilla.org/mozilla-central/rev/4d63dde701b47b8661ab7990f197b6b60e543839/tools/lint/eslint-formatter.js

Eventually eslint will also use this and we can remove that file. Once
bug 1276486 is fixed, we can make this look a little nicer. But for now
it gets the job done.

MozReview-Commit-ID: CwfWPcwWFxF

--HG--
extra : transplant_source : %F3PJ%CB%27%A5%82U%D2%CF%B3%9E%A7%9F%0F%A4%F4%E9%5D%BB
2016-05-28 23:38:30 -04:00
Carsten "Tomcat" Book c30c6ba10e Backed out changeset c48f3b04c9de (bug 1273634) 2016-06-02 15:05:01 +02:00
Andrew Halberstadt df97806e5f Bug 1273634 - [mozlint] Add a treeherder formatter, r=jgraham
This is a really simple and ugly formatter that is compatible with
treeherder's error highlighting mechanism. It is designed to be identical
to the current eslint output on treeherder:
https://dxr.mozilla.org/mozilla-central/rev/4d63dde701b47b8661ab7990f197b6b60e543839/tools/lint/eslint-formatter.js

Eventually eslint will also use this and we can remove that file. Once
bug 1276486 is fixed, we can make this look a little nicer. But for now
it gets the job done.

MozReview-Commit-ID: CwfWPcwWFxF

--HG--
extra : rebase_source : 8dd39aefec1064e0836c847c6d223db43df4755b
2016-05-28 23:38:30 -04:00
Andrew Halberstadt 464b3a9f2e Bug 1273556 - [mozlint] Better SIGINT handling, return partial results on Ctrl-C, r=jgraham
Currently a bug in python (https://bugs.python.org/issue8296) is preventing a KeyboardInterrupt from
reaching the parent process, meaning we can't kill the process with SIGINT. There is a workaround to
this bug, but instead I decided to ignore SIGINT in the parent process completely. Now, each child
process is responsible for handling SIGINT on its own. Since child processes should all shutdown
relatively quickly anyway, this effectively also ends the parent process.

The benefit of doing it this way is that each child process can return the results they have collected
to date. So when a developer hits Ctrl-C, they'll still see some (but not all) formatted lint output.
The downside is that a poorly implemented external linter could block the parent process from exiting
quickly, but if this happens we should just fix the linter.

MozReview-Commit-ID: 2tRJgtmoPYP

--HG--
extra : rebase_source : e72282bcc29c9b22690168dc973a817236cdf8ca
2016-05-17 12:24:42 -04:00
Andrew Halberstadt b1445349ea Bug 1270506 - [mozlint] Add python flake8 linter, r=smacleod
For now, only the following two directories will be linted:
python/mozlint
tools/lint

New directories can be added by adding them to the 'include'
directive in tools/lint/flake8.lint. They all default to the
configuration specified in topsrcdir/.flake8. Subdirectories
can override this configuration by creating their own .flake8
file.

MozReview-Commit-ID: Eag48Lnkp3l

--HG--
extra : rebase_source : 6d98c9fef80055a48cc2622848aa04c3045b747e
2016-05-05 17:21:12 -04:00