gecko-dev/tools/lint/mach_commands.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

85 lines
2.9 KiB
Python
Raw Normal View History

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import, print_function, unicode_literals
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 19:38:36 +00:00
import argparse
import os
from mozbuild.base import (
MachCommandBase,
)
from mach.decorators import (
CommandArgument,
CommandProvider,
Command,
)
here = os.path.abspath(os.path.dirname(__file__))
THIRD_PARTY_PATHS = os.path.join('tools', 'rewriting', 'ThirdPartyPaths.txt')
GLOBAL_EXCLUDES = [
'tools/lint/test/files',
]
def setup_argument_parser():
from mozlint import cli
return cli.MozlintParser()
def get_global_excludes(topsrcdir):
# exclude misc paths
excludes = GLOBAL_EXCLUDES[:]
# exclude top level paths that look like objdirs
excludes.extend([name for name in os.listdir(topsrcdir)
if name.startswith('obj') and os.path.isdir(name)])
# exclude third party paths
with open(os.path.join(topsrcdir, THIRD_PARTY_PATHS), 'r') as fh:
excludes.extend([f.strip() for f in fh.readlines()])
return excludes
@CommandProvider
class MachCommands(MachCommandBase):
@Command(
'lint', category='devenv',
description='Run linters.',
parser=setup_argument_parser)
def lint(self, *runargs, **lintargs):
"""Run linters."""
Bug 1494069 - [mozlint] Collapse exclude paths into their smallest possible set, r=egao Often we specify globs in our exclude patterns, e.g: exclude: - **/node_modules - obj* However, these globs get expanded out to *every* file that matches them. This can sometimes be thousands or even tens of thousands of files. We then pass these paths on to the underlying linters and tell them to exclude them all. This causes a lot of overhead and slows down performance. This commit implements a "collapse" function. Given a set of paths, it'll collapse them into the smallest set of parent directories that contain the original set, and that don't contain any extra files. For example, given a directory structure like this: a -- foo.txt -- b -- bar.txt -- baz.txt -- c -- ham.txt -- d -- spam.txt Then the following will happen: >>> collapse(['a/foo.txt', 'a/b/bar.txt', 'a/c/ham.txt', 'a/c/d/spam.txt']) ['a/foo.txt', 'b/bar.txt', 'c'] Since all files under directory 'c' are specified by the original set (both 'c/ham.txt' and 'c/d/spam.txt'), we can collapse it down to just 'c'. However not all files under 'b' are specified (we're missing 'a/b/baz.txt'), so we can't collapse 'b' (and by extension also can't collapse 'a'). If we had included 'a/b/baz.txt': >>> collapse(['a/foo.txt', 'a/b/bar.txt', 'a/b/baz.txt', 'a/c/ham.txt', 'a/c/d/spam.txt']) ['a'] In both cases, the smallest set of paths that contains the original set (and only the original set) is computed. The collapse function has a little bit of overhead but it's not too bad. For example collapsing all files matched by '**/node_modules' takes ~0.015s. Collapsing two full objdirs, takes ~0.6s. But a follow up commit is planned to make sure we stop using 'obj*' to reduce that overhead. Depends on D7738 Differential Revision: https://phabricator.services.mozilla.com/D7739 --HG-- extra : moz-landing-system : lando
2018-10-12 15:57:42 +00:00
self._activate_virtualenv()
from mozlint import cli, parser
lintargs.setdefault('root', self.topsrcdir)
lintargs['exclude'] = get_global_excludes(lintargs['root'])
cli.SEARCH_PATHS.append(here)
parser.GLOBAL_SUPPORT_FILES.append(os.path.join(self.topsrcdir, THIRD_PARTY_PATHS))
return cli.run(*runargs, **lintargs)
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 19:38:36 +00:00
@Command('eslint', category='devenv',
description='Run eslint or help configure eslint for optimal development.')
@CommandArgument('paths', default=None, nargs='*',
help="Paths to file or directories to lint, like "
Bug 1358540 - Change the *.lint files to be *.lint.py to better support editor integration & flake8 linting. r=smacleod MozReview-Commit-ID: 4KK2GZK7xul --HG-- rename : python/mozlint/test/linters/badreturncode.lint => python/mozlint/test/linters/badreturncode.lint.py rename : python/mozlint/test/linters/explicit_path.lint => python/mozlint/test/linters/explicit_path.lint.py rename : python/mozlint/test/linters/external.lint => python/mozlint/test/linters/external.lint.py rename : python/mozlint/test/linters/invalid_exclude.lint => python/mozlint/test/linters/invalid_exclude.lint.py rename : python/mozlint/test/linters/invalid_include.lint => python/mozlint/test/linters/invalid_include.lint.py rename : python/mozlint/test/linters/invalid_type.lint => python/mozlint/test/linters/invalid_type.lint.py rename : python/mozlint/test/linters/missing_attrs.lint => python/mozlint/test/linters/missing_attrs.lint.py rename : python/mozlint/test/linters/missing_definition.lint => python/mozlint/test/linters/missing_definition.lint.py rename : python/mozlint/test/linters/raises.lint => python/mozlint/test/linters/raises.lint.py rename : python/mozlint/test/linters/regex.lint => python/mozlint/test/linters/regex.lint.py rename : python/mozlint/test/linters/string.lint => python/mozlint/test/linters/string.lint.py rename : python/mozlint/test/linters/structured.lint => python/mozlint/test/linters/structured.lint.py rename : tools/lint/eslint.lint => tools/lint/eslint.lint.py rename : tools/lint/flake8.lint => tools/lint/flake8.lint.py rename : tools/lint/wpt.lint => tools/lint/wpt.lint.py rename : tools/lint/wpt_manifest.lint => tools/lint/wpt_manifest.lint.py extra : rebase_source : 97de88e0328e91347192672b848b286df1904ade
2017-04-21 16:31:15 +00:00
"'browser/' Defaults to the "
"current directory if not given.")
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 19:38:36 +00:00
@CommandArgument('-s', '--setup', default=False, action='store_true',
help='Configure eslint for optimal development.')
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 19:38:36 +00:00
@CommandArgument('-b', '--binary', default=None,
help='Path to eslint binary.')
@CommandArgument('--fix', default=False, action='store_true',
help='Request that eslint automatically fix errors, where possible.')
@CommandArgument('extra_args', nargs=argparse.REMAINDER,
help='Extra args that will be forwarded to eslint.')
def eslint(self, paths, extra_args=[], **kwargs):
self._mach_context.commands.dispatch('lint', self._mach_context,
linters=['eslint'], paths=paths,
argv=extra_args, **kwargs)