Bug 1353385 - Make './mach eslint --setup' a little quieter and fix the reported location of the eslint binary. r=mossop
authorMark Banner <standard8@mozilla.com>
Tue, 04 Apr 2017 16:06:14 +0100
changeset 556178 b68c5d48eebb6bddc7513b71bda2cf976145c526
parent 556177 63005e2a60863c2fa9f3fe8d31656edca3d1296d
child 556179 b69ae37197967d705118d3e5f78850f702241195
push id52480
push userbmo:standard8@mozilla.com
push dateWed, 05 Apr 2017 14:31:04 +0000
reviewersmossop
bugs1353385
milestone55.0a1
Bug 1353385 - Make './mach eslint --setup' a little quieter and fix the reported location of the eslint binary. r=mossop MozReview-Commit-ID: 3ucPJP5JXV8
tools/lint/eslint.lint
--- a/tools/lint/eslint.lint
+++ b/tools/lint/eslint.lint
@@ -73,39 +73,42 @@ 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" ]
+
     # 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
 
     # Install in-tree ESLint plugin mozilla.
     cmd = [npm_path, "install",
            os.path.join(module_path, "eslint-plugin-mozilla")]
+    cmd.extend(extra_parameters)
     print("Installing eslint-plugin-mozilla using \"%s\"..." % (" ".join(cmd)))
     if not call_process("eslint-plugin-mozilla", cmd):
         return 1
 
-    eslint_path = os.path.join(module_path, "node_modules", ".bin", "eslint")
-
     # Install in-tree ESLint plugin spidermonkey.
     cmd = [npm_path, "install",
            os.path.join(module_path, "eslint-plugin-spidermonkey-js")]
+    cmd.extend(extra_parameters)
     print("Installing eslint-plugin-spidermonkey-js using \"%s\"..." % (" ".join(cmd)))
     if not call_process("eslint-plugin-spidermonkey-js", cmd):
         return 1
 
-    eslint_path = os.path.join(module_path, "node_modules", ".bin", "eslint")
+    eslint_path = os.path.join(get_project_root(), "node_modules", ".bin", "eslint")
 
     print("\nESLint and approved plugins installed successfully!")
     print("\nNOTE: Your local eslint binary is at %s\n" % eslint_path)
 
     os.chdir(orig_cwd)
 
 
 def call_process(name, cmd, cwd=None):