Skip to content

Commit 1df3edd

Browse files
committed
add path search for pylint
1 parent 89c084f commit 1df3edd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/Tools/code_checker

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ from CIME.utils import run_cmd, run_cmd_no_fail, expect, get_python_libs_root
1111

1212
import argparse, sys, os, doctest
1313
from multiprocessing.dummy import Pool as ThreadPool
14+
from distutils.spawn import find_executable
1415

1516
###############################################################################
1617
def parse_command_line(args, description):
@@ -49,7 +50,10 @@ formatter_class=argparse.ArgumentDefaultsHelpFormatter
4950
###############################################################################
5051
def run_pylint(on_file):
5152
###############################################################################
52-
cmd = "pylint --disable I,C,R,logging-not-lazy,wildcard-import,unused-wildcard-import,fixme,broad-except,bare-except,eval-used,exec-used,global-statement %s" % on_file
53+
pylint = find_executable("pylint")
54+
expect(pylint is not None,"pylint not found")
55+
56+
cmd = "%s --disable I,C,R,logging-not-lazy,wildcard-import,unused-wildcard-import,fixme,broad-except,bare-except,eval-used,exec-used,global-statement %s" % (pylint, on_file)
5357
stat = run_cmd(cmd)[0]
5458
if stat != 0:
5559
sys.stdout.write("File %s has pylint problems, please fix\n Use command: %s\n" % (on_file, cmd))

0 commit comments

Comments
 (0)