summaryrefslogtreecommitdiff
path: root/buildscripts/eslint.py
diff options
context:
space:
mode:
authorMike Grundy <michael.grundy@10gen.com>2016-03-21 17:57:27 -0400
committerMike Grundy <michael.grundy@10gen.com>2016-03-21 17:57:34 -0400
commit20ca6518797b67206d1f23d097c61c78a3ad8810 (patch)
tree654ead1ed3de976ae5ac2be1ac6a1342d2db579f /buildscripts/eslint.py
parent200b4f971b021f792194489c8ffbc95b9f9cba35 (diff)
downloadmongo-20ca6518797b67206d1f23d097c61c78a3ad8810.tar.gz
SERVER-23254 eslint.py returns 1 on successful patch lint instead of 0
Diffstat (limited to 'buildscripts/eslint.py')
-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: