else: printer.print_check() ################################################################################################### # CHECK FOR CIRCLECI TESTS ################################################################################################### printer.print_process('Checking CircleCi tests status') passed = False for build in circle_driver.get_builds(): if build['vcs_revision'] == Helper.local_sha() and build['outcome'] == 'success': passed = True break if passed: printer.print_check() else: printer.print_error("Tests have not yet passed") ################################################################################################### # CHECK FOR LGS ################################################################################################### printer.print_process('Checking for LGs and unaddressed comments') lg_data = get_lg_data(github_driver) if lg_data['lgs_count'] < 2: printer.print_error('{0} LGs found. Suggestion: run git_list_lgs for a detail description'.format(lg_data['lgs_count'])) elif lg_data['has_unaddressed_comments']: printer.print_error('Unnaddressed comments found. Suggestion: run git_list_lgs for a detailed description') else: printer.print_check() sys.exit(printer.errors)
from GithubAPIDriver import GithubAPIDriver from GithubLGModule import get_lg_data import re from datetime import datetime lg_data = get_lg_data() lgs_count = lg_data.pop('lgs_count') lg_data.pop('has_unaddressed_comments', None) for user, data in lg_data.iteritems(): if len(data['unaddressed_comments']) > 0: if data['lgcomment'] is not None: print "{0} LGd at some point but has the following unaddressed comments:".format(user) else: print "{0} has the following unaddressed comments:".format(user) for unaddressed_comment in data['unaddressed_comments']: print '\t> ({0}) {1}'.format(unaddressed_comment['updated_at_datetime'], unaddressed_comment['html_url']) print '\t{0}'.format(unaddressed_comment['body']) print '' else: if data['lgcomment'] is not None: # All user's comments have been addressed and he has LGd, +1! print "+1 {0}: {1}".format(user, data['lgcomment']) print '' else: # User has no unaddressed comments but he has not yet LGd pass print "{0} LGs".format(lgs_count)