-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathfabfile.py
35 lines (23 loc) · 1.05 KB
/
fabfile.py
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
28
29
30
31
32
33
34
from __future__ import division
from fabric.api import local, lcd
from fabric import state
state.output['status'] = False
def dependency_graph():
local('sfood -i -q --ignore=`pwd`/lymph/services lymph | grep -v /tests/ | grep -v /utils | grep -v exceptions.py | sfood-graph -p | dot -Tpdf -o deps.pdf')
def docs(clean=False):
with lcd('docs'):
if clean:
local('make clean')
local('make html')
def coverage():
local('coverage run --timid --source=lymph -m py.test lymph')
local('coverage html')
#local('open .coverage-report/index.html')
def flakes():
import subprocess, yaml
popen = subprocess.Popen(['cloc', 'lymph', '--yaml', '--quiet'], stdout=subprocess.PIPE)
lines = int(yaml.load(popen.stdout)['Python']['code'])
flakes = int(subprocess.check_output('flake8 lymph | wc -l', shell=True))
print '%s flakes, %s lines, %.5f flakes per kLOC, one flake every %.1f lines' % (flakes, lines, 1000 * flakes / lines, lines / flakes)
def fixme():
local(r"egrep -rn '#\s*(FIXME|TODO|XXX)\b' lymph")