-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
makefile
72 lines (57 loc) · 1.69 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
62
63
64
65
66
67
68
69
70
71
72
SHELL := bash
.ONESHELL:
.SHELLFLAGS := -eu -o pipefail -c
.DELETE_ON_ERROR:
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
.DEFAULT_GOAL := help
install: ## install all dependencies locally
poetry install
.PHONY: install
update: ## update project dependencies locally (run after git update)
poetry update
.PHONY: update
ci: codespell lint bandit test ## Run all checks (codespell, lint, bandit, test)
.PHONY: ci
test: ## Run tests
poetry run pytest . --no-cov
.PHONY: test
lint: ## Run linting with flake8
poetry run flake8 . \
--count \
--ignore=F841,W503 \
--max-complexity=26 \
--max-line-length=88 \
--statistics \
--exclude .venv
.PHONY: lint
codespell: ## Find typos with codespell
poetry run codespell --ignore-words-list=nd,nin --skip=".venv"
.PHONY: codespell
bandit: ## Run static security analysis with bandit
poetry run bandit app -r
.PHONY: bandit
lint-fix: ## Run autoformatters
poetry run black .
poetry run isort .
.PHONY: lint-fix
typecheck: ## Run typechecking
poetry run mypy --show-error-codes --pretty .
.PHONY: typecheck
docs-build: ## Build documentation
poetry run mkdocs build
.PHONY: docs-build
docs-serve: docs-build ## Build docs and server on port localhost:5000
poetry run mkdocs serve --dev-addr 127.0.0.1:5000
.PHONY: docs-serve
docs-clean: ## Cleanup docs generation
rm -rf site/
.PHONY: docs-clean
docker-compose: ## Run docker-compose
docker-compose up
.PHONY: docker-compose
salted: ## generate salt
poetry run python gen_Salt.py
.PHONY: salted
help: Makefile
@grep -E '(^[a-zA-Z_-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/'