summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Grundy <michael.grundy@10gen.com>2016-03-21 17:57:27 -0400
committerRamon Fernandez <ramon@mongodb.com>2016-03-22 12:56:13 -0400
commit122fe542f41936d8555f797ce5275154379164e8 (patch)
tree49ef31fd13c32fedb504a3573b79834a813e1d54
parent53aebe079abfe52a4db1a2414c2b1be11834e5ea (diff)
downloadmongo-122fe542f41936d8555f797ce5275154379164e8.tar.gz
SERVER-23254 eslint.py returns 1 on successful patch lint instead of 0
(cherry picked from commit 20ca6518797b67206d1f23d097c61c78a3ad8810)
-rwxr-xr-xbuildscripts/eslint.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/buildscripts/eslint.py b/buildscripts/eslint.py
index 1c706edbc61..f91423c1255 100755
--- a/buildscripts/eslint.py
+++ b/buildscripts/eslint.py
@@ -466,6 +466,8 @@ def _lint_files(eslint, files):
"files that were skipped")
sys.exit(1)
+ return True
+
def lint_patch(eslint, infile):
"""Lint patch command entry point
"""
@@ -517,7 +519,8 @@ def main():
usage = "%prog [-e <eslint>] [-d] lint|lint-patch|fix [glob patterns] "
description = "lint runs ESLint on provided patterns or all .js files under jstests/ "\
"and src/mongo. lint-patch runs ESLint against .js files modified in the "\
- "patch file (for upload.py). fix runs ESLint with --fix on provided patterns "\
+ "provided patch file (for upload.py). "\
+ "fix runs ESLint with --fix on provided patterns "\
"or files under jstests/ and src/mongo."
epilog ="*Unless you specify -d a separate ESLint process will be launched for every file"
parser = OptionParser()
@@ -532,7 +535,6 @@ def main():
if len(args) > 1:
command = args[1]
-
searchlist = args[2:]
if not searchlist:
searchlist = ["jstests/", "src/mongo/"]
@@ -540,7 +542,11 @@ def main():
if command == "lint":
success = lint(options.eslint, options.dirmode, searchlist)
elif command == "lint-patch":
- success = lint_patch(options.eslint, searchlist)
+ if not args[2:]:
+ success = False
+ print("You must provide the patch's fully qualified file name with lint-patch")
+ else:
+ success = lint_patch(options.eslint, searchlist)
elif command == "fix":
success = autofix_func(options.eslint, options.dirmode, searchlist)
else: