Backed out changeset eec770d062b4 (bug 1358540) for bustage
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Tue, 25 Apr 2017 10:15:07 +0200
changeset 402863 4653b1d21e8702461bab684af135ec8fcddf6cd6
parent 402862 0d5af288c8693b6cafef739d5b4998b9008bbfc8
child 402864 83f12eb017b63396a0bfeffa8c72d640ce0ce2b6
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1358540
milestone55.0a1
backs outeec770d062b42f8c12f01391b4e715a7f082b2cf
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset eec770d062b4 (bug 1358540) for bustage
python/mozlint/mozlint/cli.py
python/mozlint/mozlint/parser.py
python/mozlint/mozlint/result.py
tools/lint/eslint.lint
tools/lint/eslint.lint.py
tools/lint/flake8.lint
tools/lint/flake8.lint.py
tools/lint/mach_commands.py
tools/lint/wpt.lint
tools/lint/wpt.lint.py
tools/lint/wpt_manifest.lint
tools/lint/wpt_manifest.lint.py
--- a/python/mozlint/mozlint/cli.py
+++ b/python/mozlint/mozlint/cli.py
@@ -81,23 +81,20 @@ class MozlintParser(ArgumentParser):
 def find_linters(linters=None):
     lints = []
     for search_path in SEARCH_PATHS:
         if not os.path.isdir(search_path):
             continue
 
         files = os.listdir(search_path)
         for f in files:
-            name = os.path.basename(f)
-
-            if not name.endswith('.lint.py'):
+            name, ext = os.path.splitext(f)
+            if ext != '.lint':
                 continue
 
-            name = name.rsplit('.', 2)[0]
-
             if linters and name not in linters:
                 continue
 
             lints.append(os.path.join(search_path, f))
     return lints
 
 
 def run(paths, linters, fmt, rev, outgoing, workdir, **lintargs):
--- a/python/mozlint/mozlint/parser.py
+++ b/python/mozlint/mozlint/parser.py
@@ -7,17 +7,17 @@ import os
 import sys
 import uuid
 
 from .types import supported_types
 from .errors import LinterNotFound, LinterParseError
 
 
 class Parser(object):
-    """Reads and validates `.lint.py` files."""
+    """Reads and validates `.lint` files."""
     required_attributes = (
         'name',
         'description',
         'type',
         'payload',
     )
 
     def __call__(self, path):
@@ -72,14 +72,14 @@ class Parser(object):
 
         :param path: Path to the linter.
         :returns: Linter definition (dict)
         :raises: LinterNotFound, LinterParseError
         """
         if not os.path.isfile(path):
             raise LinterNotFound(path)
 
-        if not path.endswith('.lint.py'):
-            raise LinterParseError(path, "Invalid filename, linters must end with '.lint.py'!")
+        if not path.endswith('.lint'):
+            raise LinterParseError(path, "Invalid filename, linters must end with '.lint'!")
 
         linter = self._load_linter(path)
         self._validate(linter)
         return linter
--- a/python/mozlint/mozlint/result.py
+++ b/python/mozlint/mozlint/result.py
@@ -66,17 +66,17 @@ class ResultEncoder(JSONEncoder):
 
 
 def from_linter(lintobj, **kwargs):
     """Create a :class:`~result.ResultContainer` from a LINTER definition.
 
     Convenience method that pulls defaults from a LINTER
     definition and forwards them.
 
-    :param lintobj: LINTER obj as defined in a .lint.py file
+    :param lintobj: LINTER obj as defined in a .lint file
     :param kwargs: same as :class:`~result.ResultContainer`
     :returns: :class:`~result.ResultContainer` object
     """
     attrs = {}
     for attr in ResultContainer.__slots__:
         attrs[attr] = kwargs.get(attr, lintobj.get(attr))
 
     if not attrs['linter']:
rename from tools/lint/eslint.lint.py
rename to tools/lint/eslint.lint
--- a/tools/lint/eslint.lint.py
+++ b/tools/lint/eslint.lint
@@ -73,17 +73,17 @@ def eslint_setup():
     # npm sometimes fails to respect cwd when it is run using check_call so
     # we manually switch folders here instead.
     os.chdir(get_project_root())
 
     npm_path = get_node_or_npm_path("npm")
     if not npm_path:
         return 1
 
-    extra_parameters = ["--loglevel=error"]
+    extra_parameters = [ "--loglevel=error" ]
 
     # Install ESLint and external plugins
     cmd = [npm_path, "install"]
     cmd.extend(extra_parameters)
     print("Installing eslint for mach using \"%s\"..." % (" ".join(cmd)))
     if not call_process("eslint", cmd):
         return 1
 
rename from tools/lint/flake8.lint.py
rename to tools/lint/flake8.lint
--- a/tools/lint/flake8.lint.py
+++ b/tools/lint/flake8.lint
@@ -109,17 +109,17 @@ def get_flake8_binary():
 
 
 def _run_pip(*args):
     """
     Helper function that runs pip with subprocess
     """
     try:
         subprocess.check_output(['pip'] + list(args),
-                                stderr=subprocess.STDOUT)
+                                      stderr=subprocess.STDOUT)
         return True
     except subprocess.CalledProcessError as e:
         print(e.output)
         return False
 
 
 def reinstall_flake8():
     """
--- a/tools/lint/mach_commands.py
+++ b/tools/lint/mach_commands.py
@@ -41,17 +41,17 @@ class MachCommands(MachCommandBase):
         cli.SEARCH_PATHS.append(here)
         self._activate_virtualenv()
         return cli.run(*runargs, **lintargs)
 
     @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 "
-                          "'browser/' Defaults to the "
+                          "'browser/components/loop' Defaults to the "
                           "current directory if not given.")
     @CommandArgument('-s', '--setup', default=False, action='store_true',
                      help='Configure eslint for optimal development.')
     @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,
rename from tools/lint/wpt.lint.py
rename to tools/lint/wpt.lint
rename from tools/lint/wpt_manifest.lint.py
rename to tools/lint/wpt_manifest.lint
--- a/tools/lint/wpt_manifest.lint.py
+++ b/tools/lint/wpt_manifest.lint
@@ -1,16 +1,22 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
 import imp
+import json
 import os
+import sys
+
+from mozprocess import ProcessHandler
+
+from mozlint import result
 
 
 def lint(files, logger, **kwargs):
     wpt_dir = os.path.join(kwargs["root"], "testing", "web-platform")
     manifestupdate = imp.load_source("manifestupdate",
                                      os.path.join(wpt_dir, "manifestupdate.py"))
     manifestupdate.update(logger, wpt_dir, True)