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

21 Коммитов

Автор SHA1 Сообщение Дата
Francesco Pischedda 78c3624c28 Bug 1285555 - [flake8] Automatically install/update flake8 package to correct version r=ahal
Changed flake8 installation strategy, try to update it using testings/lint/flake8_requirements.txt
moved flake8_requirements to tools/lint/flake8 directory
extracted common pip invocations to _run_pip function
minor fixes
fixed calls to check_process (concatenating list to tuple)
removed update_pip function and its error message variable
if flake8 installation reports and error print pip command output - replaced out with e.output in print function

MozReview-Commit-ID: Fmq22aL8dMq

--HG--
extra : rebase_source : 2e2f942c1ffab012795c632ceacf6debf0dc1407
2016-10-15 09:45:22 +02:00
Philipp Kewisch 7a35040ddc Bug 1306366 - mach eslint no longer accepts --no-ignore as a parameter. r=ahal
MozReview-Commit-ID: LpT0Qlv6vsE

--HG--
extra : rebase_source : ea59047c9b9029c7e5362e68499b24a0eac67eb1
2016-10-14 14:20:23 +02:00
Andrew Halberstadt 9703ac2438 Bug 1258341 - Modify 'eslint' implementation to work with the mozlint framework, r=smacleod
This integrates 'eslint' with the mozlint framework. The old |mach eslint| command is kept around
for backwards compatibility and will simply dispatch to |mach lint|. But |mach lint| should be
preferred as the old command may eventually be removed.

The old |mach eslint| command should be mostly backwards compatible with a few exceptions:

    1. Can no longer define --extensions on the command line, this is instead hardcoded into
       eslint.lint.
    2. No longer using eslint formatters. However, the default mozlint formatter should be
       identical to the default eslint formatter, so developers should not notice a change.
       This does mean that non-default eslint formatters can no longer be used unless a mozlint
       copy of them is created.
    3. Installs dependencies automatically without prompting the user. This was necessary due to
       python multiprocessing limitations, but is actually also a better UX. Because the npm
       dependencies aren't global anymore, there isn't really any reason *not* to install them
       automatically.

Apart from that, any difference from the old |mach eslint| I'd consider a bug.

The main eslint implementation now lives in tools/lint/eslint.lint instead of
tools/lint/mach_commands.py.


MozReview-Commit-ID: KYhC6SEySC3

--HG--
extra : rebase_source : 36d06b1a3fced764e17154cc53091d7722919b67
2016-08-30 14:28:56 -04:00
Matthew Noorenberghe a59bf6717f Bug 1270926 - Support ESLint on XHTML files. r=ahal
MozReview-Commit-ID: 4iYODbZQiB9
2016-08-23 14:42:21 -07:00
Jared Wein df53d45313 Bug 1291910 - Add ability for mach eslint to accept --fix. r=Felipe
MozReview-Commit-ID: 5PB2oI2jPri

--HG--
extra : rebase_source : 42d03b9ab93c4ef390d0dfa59d25dd330309071d
2016-08-03 19:18:55 -04:00
J. Ryan Stinnett c9822d13cd Bug 1288225 - Exclude eslint-plugin-mozilla from tooltool. r=ahal
This removes the in-tree plugin from the tooltool archive and uses that code
directly from the Gecko checkout instead.

For automation, we now get ESLint and external plugins from tooltool and then
symbolic link to the in-tree plugin.

For local development, we install ESLint and external plugins following the
shrinkwrap file created from the last change to the tooltool archive.  The local
plugin is then installed.

This change also removes the list of module versions from mach_commands.py, so
there is only one place to update module versions for the future.

MozReview-Commit-ID: AhbZ8lVPmN4
2016-07-28 11:53:54 -05:00
J. Ryan Stinnett f8c4ba2279 Bug 1288225 - Use PEP 8 style for method names. r=ahal
MozReview-Commit-ID: 7ci9vAdUw0J
2016-07-28 11:53:54 -05:00
Tom Tromey 8cd914069c Bug 1264649 - add reject-some-requires eslint rule; r=pbro
MozReview-Commit-ID: FVxy2c5Wsgg

--HG--
extra : rebase_source : 901f8aee971f9ab48cef7eceffb4cfc8ad567822
2016-07-21 08:39:29 -06:00
Julian Descottes 095a6309b9 Bug 1285936 - eslint mozilla plugin: fix filename in import globals & bump to 0.1.1
The file base/content/browser-fullScreen.js was renamed. This patch updates the reference
to this filename in the esling rule import-browserjs-globals.js and bumps the version to
0.1.1.

MozReview-Commit-ID: 9hibfDnbtp
2016-07-19 12:51:47 -05:00
Andrew Halberstadt 3c8be23f37 Bug 1281899 - [mozlint] Add ability to lint files touched by revisions and/or the working directory, r=smacleod
This adds two parameters, --rev and --workdir. Each works both with mercurial and git (though the syntax for
specifying revisions is different between them). The value is simply forwarded to either |hg log| or |git diff|
so syntax like |mach lint -r .~4::.| or |mach lint -r "HEAD~4 HEAD"| will work as expected.

MozReview-Commit-ID: aOGp2Yrncs

--HG--
extra : rebase_source : d2cb834d4cc1a083171a3551af4e72c8a7d14021
2016-06-24 14:09:58 -04:00
Andrew Halberstadt 482f8a956c Bug 1281899 - [mozlint] Create cli module and move logic from tools/lint/mach_commands.py there, r=smacleod
There is currently no built-in user interface to mozlint. The only existing interface is the
external cli provided by |mach lint|. However, in the future mozlint may need to be used in a
context where mach isn't readily available (i.e version-control-tools). This patch basically
just moves the cli logic out of mach_commands.py, and into mozlint core. That way it can be
re-used in other places without needing to be re-implemented.

The |mach lint setup| subcommand was removed because apparently subcommands don't work with
the parser attribute. Nothing was using it yet anyway, so I removed it for now. It may get
re-added in some form in the future.

MozReview-Commit-ID: aOGp2Yrncs

--HG--
extra : rebase_source : 8f7530de96e5c131d2ed5bfcdd7a159329401e5b
2016-06-24 14:06:22 -04:00
Carsten "Tomcat" Book c6816bf0df merge mozilla-inbound to mozilla-central a=merge 2016-06-12 11:26:13 +02:00
J. Ryan Stinnett 51611069ed Bug 1279515 - Update ESLint plugin version after rule change. r=jdescottes
MozReview-Commit-ID: ECSIVMfsGHL
2016-06-10 11:28:03 -05:00
Andrew Halberstadt 13a551f7f9 Bug 1277641 - [mozlint] Add --no-filter option to make experimenting locally easier, r=smacleod
This makes it easier to lint a path that otherwise wouldn't have been linted due to the include/exclude
directives. Now, you can pass in -n/--no-filter instead of needing to modify the linter configuration file.

MozReview-Commit-ID: GMJuE2C1NyY

--HG--
extra : rebase_source : 03627e930f76903ad629cb01b58c4ae7372e4bb1
2016-06-02 15:14:07 -04:00
Julian Descottes eace7c89ed Bug 1279210 - eslint setup: fix eslint module path;r=ahal
MozReview-Commit-ID: HL4tIwgkSau

--HG--
extra : rebase_source : 8169cbc543528a6b2a6e2bffbf4a202dfcea1a93
2016-06-09 14:40:48 +02:00
Andrew Halberstadt fc24b11e43 Bug 1271734 - Move all eslint related infrastructure to tools/lint, r=miker
This commit simply moves 'testing/eslint' to 'tools/lint/eslint' and the eslint related
mach command from 'python/mach_commands.py' to 'tools/lint/mach_commands.py'. It shouldn't
have any functional change on running eslint, either through mach or taskcluster.

This is in preparation for bug 1258341, to make the diffs there a little easier to read.

MozReview-Commit-ID: K03sn9lv9Lv

--HG--
rename : testing/eslint/eslint-plugin-mozilla/LICENSE => tools/lint/eslint/eslint-plugin-mozilla/LICENSE
rename : testing/eslint/eslint-plugin-mozilla/docs/balanced-listeners.rst => tools/lint/eslint/eslint-plugin-mozilla/docs/balanced-listeners.rst
rename : testing/eslint/eslint-plugin-mozilla/docs/import-browserjs-globals.rst => tools/lint/eslint/eslint-plugin-mozilla/docs/import-browserjs-globals.rst
rename : testing/eslint/eslint-plugin-mozilla/docs/import-globals.rst => tools/lint/eslint/eslint-plugin-mozilla/docs/import-globals.rst
rename : testing/eslint/eslint-plugin-mozilla/docs/import-headjs-globals.rst => tools/lint/eslint/eslint-plugin-mozilla/docs/import-headjs-globals.rst
rename : testing/eslint/eslint-plugin-mozilla/docs/index.rst => tools/lint/eslint/eslint-plugin-mozilla/docs/index.rst
rename : testing/eslint/eslint-plugin-mozilla/docs/mark-test-function-used.rst => tools/lint/eslint/eslint-plugin-mozilla/docs/mark-test-function-used.rst
rename : testing/eslint/eslint-plugin-mozilla/docs/no-aArgs.rst => tools/lint/eslint/eslint-plugin-mozilla/docs/no-aArgs.rst
rename : testing/eslint/eslint-plugin-mozilla/docs/no-cpows-in-tests.rst => tools/lint/eslint/eslint-plugin-mozilla/docs/no-cpows-in-tests.rst
rename : testing/eslint/eslint-plugin-mozilla/docs/reject-importGlobalProperties.rst => tools/lint/eslint/eslint-plugin-mozilla/docs/reject-importGlobalProperties.rst
rename : testing/eslint/eslint-plugin-mozilla/docs/var-only-at-top-level.rst => tools/lint/eslint/eslint-plugin-mozilla/docs/var-only-at-top-level.rst
rename : testing/eslint/eslint-plugin-mozilla/lib/globals.js => tools/lint/eslint/eslint-plugin-mozilla/lib/globals.js
rename : testing/eslint/eslint-plugin-mozilla/lib/helpers.js => tools/lint/eslint/eslint-plugin-mozilla/lib/helpers.js
rename : testing/eslint/eslint-plugin-mozilla/lib/index.js => tools/lint/eslint/eslint-plugin-mozilla/lib/index.js
rename : testing/eslint/eslint-plugin-mozilla/lib/processors/xbl-bindings.js => tools/lint/eslint/eslint-plugin-mozilla/lib/processors/xbl-bindings.js
rename : testing/eslint/eslint-plugin-mozilla/lib/rules/.eslintrc => tools/lint/eslint/eslint-plugin-mozilla/lib/rules/.eslintrc
rename : testing/eslint/eslint-plugin-mozilla/lib/rules/balanced-listeners.js => tools/lint/eslint/eslint-plugin-mozilla/lib/rules/balanced-listeners.js
rename : testing/eslint/eslint-plugin-mozilla/lib/rules/import-browserjs-globals.js => tools/lint/eslint/eslint-plugin-mozilla/lib/rules/import-browserjs-globals.js
rename : testing/eslint/eslint-plugin-mozilla/lib/rules/import-globals.js => tools/lint/eslint/eslint-plugin-mozilla/lib/rules/import-globals.js
rename : testing/eslint/eslint-plugin-mozilla/lib/rules/import-headjs-globals.js => tools/lint/eslint/eslint-plugin-mozilla/lib/rules/import-headjs-globals.js
rename : testing/eslint/eslint-plugin-mozilla/lib/rules/mark-test-function-used.js => tools/lint/eslint/eslint-plugin-mozilla/lib/rules/mark-test-function-used.js
rename : testing/eslint/eslint-plugin-mozilla/lib/rules/no-aArgs.js => tools/lint/eslint/eslint-plugin-mozilla/lib/rules/no-aArgs.js
rename : testing/eslint/eslint-plugin-mozilla/lib/rules/no-cpows-in-tests.js => tools/lint/eslint/eslint-plugin-mozilla/lib/rules/no-cpows-in-tests.js
rename : testing/eslint/eslint-plugin-mozilla/lib/rules/reject-importGlobalProperties.js => tools/lint/eslint/eslint-plugin-mozilla/lib/rules/reject-importGlobalProperties.js
rename : testing/eslint/eslint-plugin-mozilla/lib/rules/var-only-at-top-level.js => tools/lint/eslint/eslint-plugin-mozilla/lib/rules/var-only-at-top-level.js
rename : testing/eslint/eslint-plugin-mozilla/moz.build => tools/lint/eslint/eslint-plugin-mozilla/moz.build
rename : testing/eslint/eslint-plugin-mozilla/package.json => tools/lint/eslint/eslint-plugin-mozilla/package.json
rename : testing/eslint/manifest.tt => tools/lint/eslint/manifest.tt
rename : testing/eslint/npm-shrinkwrap.json => tools/lint/eslint/npm-shrinkwrap.json
rename : testing/eslint/package.json => tools/lint/eslint/package.json
rename : testing/eslint/update => tools/lint/eslint/update
extra : rebase_source : bb44b6285acf4625079cb6a3aaca7d9ada778c3a
2016-06-02 15:38:36 -04:00
Andrew Halberstadt 557cd94acb Bug 1273634 - [mozlint] Create a flake8 task, r=dustin
Enables flake8 linting! To start, only these directories are actually linted:
- python/mozlint
- tools/lint

To enable new directories, add them to the 'include' directive at the bottom of:
tools/lint/flake8.lint

Edit topsrcdir/.flake8 to modify global configuration. Add a new .flake8 to a
subdirectory to override the global. The current configuration is more or less
just the default and we should tweak it to our needs.

MozReview-Commit-ID: iXbToRhm3b

--HG--
extra : transplant_source : %E7i%04%07%1C%B3%E4%FD%FF%BB%A6w%CF%27t%FFz%CD%5EE
2016-05-17 16:24:24 -04:00
Carsten "Tomcat" Book 3891fd3556 Backed out changeset 3f521a9d4d1f (bug 1273634) 2016-06-02 15:05:00 +02:00
Andrew Halberstadt f6bad5ec2a Bug 1273634 - [mozlint] Create a flake8 task, r=garndt
Enables flake8 linting! To start, only these directories are actually linted:
- python/mozlint
- tools/lint

To enable new directories, add them to the 'include' directive at the bottom of:
tools/lint/flake8.lint

Edit topsrcdir/.flake8 to modify global configuration. Add a new .flake8 to a
subdirectory to override the global. The current configuration is more or less
just the default and we should tweak it to our needs.

MozReview-Commit-ID: iXbToRhm3b

--HG--
extra : rebase_source : 78c4491261ba36421110b0d9fca73c1f6d1f85c3
2016-05-17 16:24:24 -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
Andrew Halberstadt 0484cb2aa7 Bug 1230962 - Create mach/build system integration for mozlint, r=smacleod
MozReview-Commit-ID: 74ma5uMOphe

--HG--
extra : rebase_source : 3b0594650a364ad598fc12cc38f3e4fd916ca26b
2016-03-18 13:54:07 -04:00