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