def execute_pychecker (project, logger): command_line = build_command_line(project) logger.info("Executing pychecker on project sources: %s" % (' '.join(command_line))) _, report_file = execute_tool_on_modules(project, "pychecker", command_line, True) warnings = read_file(report_file) report = parse_pychecker_output(project, warnings) project.write_report("pychecker.json", render_report(report.to_json_dict())) if len(warnings) != 0: logger.warn("Found %d warning%s produced by pychecker. See %s for details.", len(warnings), "s" if len(warnings) != 1 else "", report_file) threshold = project.get_property("pychecker_break_build_threshold") if project.get_property("pychecker_break_build") and len(warnings) > threshold: raise BuildFailedException("Found warnings produced by pychecker")
def execute_pylint (project, logger): logger.info("Executing pylint on project sources") execute_tool_on_modules(project, "pylint", "pylint", True)