Ejemplo n.º 1
0
def analyze (project, logger):
    logger.info("Executing pep8 on project sources")
    _, report_file = execute_tool_on_source_files(project, "pep8", ["pep8"])
    
    reports = read_file(report_file)
    
    if len(reports) > 0:
        logger.warn("Found %d warning%s produced by pep8", 
                    len(reports), "" if len(reports) == 1 else "s")    
Ejemplo n.º 2
0
def analyze (project, logger):
    """
        Applies the flake8 script to the sources of the given project.
    """

    logger.info("Applying flake8 to project sources.")
    execution_result  = execute_tool_on_source_files(project=project,
                                                     name="flake8",
                                                     command_and_arguments=["flake8"])
                                           
    report_file       = execution_result[1]
    report_lines      = read_file(report_file)
    count_of_warnings = len(report_lines)

    if count_of_warnings > 0:
        logger.warn("flake8 found %d warning(s).", count_of_warnings)