-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
61 lines (52 loc) · 1.93 KB
/
Makefile
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
export BBOT_ENV=development
export FLASK_ENV=development
export FLASK_APP=channels.web.app
.PHONY: all clean console coverage lint lintdoc static test uml web
all:
@echo
@echo "Usage:"
@echo " make [options]"
@echo
@echo "Options:"
@echo " clean Clean temp files"
@echo " coverage Create code coverage report"
@echo " lint Analyze source code to flag programming errors, bugs, etc."
@echo " lintdoc Analyze docstrings in the source code"
@echo " static Run a static type checker"
@echo " test Run unit tests"
@echo " uml Create uml diagrams"
@echo " web Run web app (development mode)"
@echo " console Run console app (development mode)"
@echo
clean:
@find . -name "*.pyc" -print0 | xargs -0 rm -rf
@find . -name "*.pyo" -print0 | xargs -0 rm -rf
coverage: clean
@rm -rf htmlcov
@rm -rf .coverage
@coverage run -m pytest && coverage report && coverage html
lint: clean
@pylint --output-format=colorized --rcfile=./.pylintrc ./bbot
@pylint --output-format=colorized --rcfile=./.pylintrc ./channels/console
@pylint --output-format=colorized --rcfile=./.pylintrc ./channels/web
@pylint --output-format=colorized --rcfile=./.pylintrc ./flow
@pylint --output-format=colorized --rcfile=./.pylintrc ./tests
lintdoc: clean
@pep257 ./bbot
@pep257 ./channels/console
@pep257 ./channels/web
@pep257 ./flow
@pep257 ./tests
static: clean
@mypy --ignore-missing-imports ./bbot
@mypy --ignore-missing-imports ./channels/console
@mypy --ignore-missing-imports ./channels/web
@mypy --ignore-missing-imports ./flow
@mypy --ignore-missing-imports ./tests
test: clean
@python -m pytest -s
uml: clean
@pyreverse flow bbot && \
dot -Tpng classes.dot -Nfontname=Arial -Nfontsize=10 -Efontname=Arial -Efontsize=10 -s1 -o classes.png && \
dot -Tpng packages.dot -Nfontname=Arial -Nfontsize=10 -Efontname=Arial -Efontsize=10 -s1 -o packages.png
@rm classes.dot packages.dot