#!/usr/bin/python
from __future__ import print_function

import sys

from automation_tools import run_pylint

if __name__ == "__main__":

    passes = run_pylint(['./lint.py', '--noerrors']) # Can't push to origin if pylint finds any errors!
    if int(passes) > 0:
        sys.exit(1)
    '''

    output = get_output(['git', 'log', '--merges'])
    output = [line for line in output.splitlines() if line.count(branchname) < 2 and 'into %s' % branchname in line]
    with open('doc/%s_merge_log.txt' % branchname, 'w') as merge_log:
        merge_log.write('\n'.join(output))
    
    #fmt = '%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n''          %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'
    lg1 = ['git', 'log', '--graph', '--abbrev-commit']#, 
            #'--decorate', '--format=format:'+fmt, '--all'] 

    output = get_output(lg1)
    output = [line for line in output.splitlines() if line.count(branchname) < 2 and 'into %s' % branchname in line]
    print('\n'.join(output))
    '''

