def package_analysis(iface, scope):
FNULL = open(os.devnull, "w")
output = open(scope.id + ".xml", "w")
try:
subprocess.call(["cppcheck", "--xml-version=2", "--enable=all",
"--rule-file=" + iface.get_file("rules.xml"),
scope.path
], stdout=FNULL, stderr=output)
finally:
FNULL.close()
output.close()
files = file_mapping(scope)
try:
xml = ET.parse(scope.id + ".xml").getroot()
errors = xml.find("errors")
for error in errors:
handle_report(iface, files, error)
except ET.ParseError as e:
pass
评论列表
文章目录