-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (42 loc) · 1.7 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
SOURCES := $(wildcard *.py)
TESTS := test_main.py
INPUTS := ~/Downloads/bork.html /tmp/sep.csv
ENTRYPOINT_DEPS := $(SOURCES) $(INPUTS) $(TESTS)
# Porcelain
# ###############
.PHONY: container run lint test watch
enter_command = ls $(ENTRYPOINT_DEPS) | entr -cr make --no-print-directory $(1)
watch: ## run app on every change
$(call enter_command,run)
run: setup ## run the app
python3 main.py
lint: setup ## run static analysis
@echo "Not implemented"; false
test: setup ## run all tests
python3 -m pytest --cov-report term-missing --cov .
iterate: ## run tests on every change
$(call enter_command,test)
container: build ## create container
#docker build -t lmap .
@echo "Not implemented"; false
# Plumbing
# ###############
.PHONY: setup gitclean gitclean-with-libs
setup:
gitclean:
@# will remove everything in .gitignore expect for blocks starting with dep* or lib* comment
diff --new-line-format="" --unchanged-line-format="" <(grep -v '^#' .gitignore | grep '\S' | sort) <(awk '/^# *(dep|lib)/,/^$/' testowy | head -n -1 | tail -n +2 | sort) | xargs rm -rf
gitclean-with-libs:
diff --new-line-format="" --unchanged-line-format="" <(grep -v '^#' .gitignore | grep '\S' | sort) | xargs rm -rf
# Utilities
# ###############
.PHONY: help todo clean really_clean init
init: ## one time setup
direnv allow .
todo: ## list all TODOs in the project
git grep -I --line-number TODO | grep -v 'list all TODOs in the project' | grep TODO
clean: gitclean ## remove artifacts
really_clean: gitclean-with-libs ## remove EVERYTHING
help: ## print this message
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.DEFAULT_GOAL := help