/
pre-push
executable file
·28 lines (20 loc) · 1.04 KB
/
pre-push
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/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))
'''