35 Run a specified linter in a subprocess, checking its return status. 37 This is a unit test script for roslint. 40 from __future__
import print_function
45 def main(returnstatus, linter, files):
48 :param: returnstatus expected return status 49 :param: linter command string for running the linter with its options. 50 :param: files list of file names to process 52 :returns: 0 if test successful, 1 otherwise. 54 cmd = linter.split() + files
55 print(
'lint command: ' +
' '.join(cmd))
56 sub_rc = subprocess.call(cmd)
57 if sub_rc != int(returnstatus):
63 if __name__ ==
'__main__':
69 ret_status =
main(sys.argv[1], sys.argv[2], sys.argv[3:])
71 print(
'usage: runlint returnstatus linter file1 [ file2 ... ]')
def main(returnstatus, linter, files)