Misra.py fix multiple file processing (#1332)

* MISRA addon: Support multiple files with argparse

* MISRA addon fix exit code 

Fix to run all dump files then exit with error code if any error in any file found.
This commit is contained in:
Kyle Chisholm 2018-08-09 02:51:00 -04:00 committed by Daniel Marjamäki
parent 9e3b392ec6
commit 4e25da7b9d
1 changed files with 6 additions and 2 deletions

View File

@ -1836,7 +1836,7 @@ def parseDump(dumpfile):
print("\nRule violations found: %d\n" % (len(VIOLATIONS)))
exitCode = 1
sys.exit(exitCode)
return exitCode
RULE_TEXTS_HELP = '''Path to text file of MISRA rules
@ -1900,5 +1900,9 @@ else:
if args.no_summary:
SHOW_SUMMARY = False
if args.dumpfile:
exitCode = 0
for item in args.dumpfile:
parseDump(item)
checkCode = parseDump(item)
if checkCode != 0:
exitCode = checkCode
sys.exit(exitCode)