-
Notifications
You must be signed in to change notification settings - Fork 29
/
Makefile
51 lines (41 loc) · 1.21 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
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,E741 \
--max-complexity=26 \
--max-line-length=88 \
--statistics \
--exclude .venv,venv
.PHONY: lint
codespell: ## Find typos with codespell
poetry run codespell --ignore-words-list=nd,nin --skip=".venv,venv,.git"
.PHONY: codespell
bandit: ## Run static security analysis with bandit
poetry run bandit montydb -r
.PHONY: bandit
build: ## Build project using poetry
poetry build
.PHONY: build
clean: ## Clean project
rm -rf build dist
.PHONY: clean
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/'