Bug 1353385 - Make './mach eslint --setup' a little quieter and fix the reported location of the eslint binary. r?Mossop draft
authorMark Banner <standard8@mozilla.com>
Tue, 04 Apr 2017 16:06:14 +0100
changeset 555599 d7f47e8276386da44468c1c7e6aec453a027c60b
parent 555310 b5d8b27a753725c1de41ffae2e338798f3b5cacd
child 622641 6980e9c1f3bf3b7e9bd667bf6fb77d3ebfb753a8
push id52275
push userbmo:standard8@mozilla.com
push dateTue, 04 Apr 2017 15:09:37 +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):