-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (45 loc) · 1.71 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
SHELL = /bin/bash -c
VIRTUAL_ENV = $(shell poetry env info --path)
export BASH_ENV=$(VIRTUAL_ENV)/bin/activate
.DEFAULT_GOAL:=help
.PHONY: help
help: ## Display this help
$(info aws-iam-login - simplify AWS logins)
awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z0-9_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
.PHONY: lint
lint: _black _mypy ## Lint all project files
.PHONY: test
test: lint ## Run the test suite defined in the project
pytest --cov --cov-report term-missing --junitxml=reports/pytest.xml --cov-report xml:reports/coverage.xml
.PHONY: install
install: $(VIRTUAL_ENV) ## Install all dependencies
poetry install
.PHONY: clean
clean: ## Cleanup removes all temporary local files and folders
[[ -d "$(VIRTUAL_ENV)" ]] && rm -rf "$(VIRTUAL_ENV)" || true
[[ -d .mypy_cache ]] && rm -rf .mypy_cache || true
[[ -d .pytest_cache ]] && rm -rf .pytest_cache || true
[[ -d dist ]] && rm -rf dist || true
[[ -d reports ]] && rm -rf reports || true
[[ -f .coverage ]] && rm .coverage || true
.PHONY: build
build: ## Build the project
poetry build
.PHONY: release
release: build ## Create a release
twine upload dist/*
.PHONY: complexity
complexity: ## Perform complixity scanning
$(info Maintenability index)
radon mi --min A --max A --show --sort aws_iam_login
$(info Cyclomatic complexity index)
xenon --max-absolute A --max-modules A --max-average A aws_iam_login
.PHONY: _black
_black:
$(info [*] Formatting python files...)
black .
.PHONY: _mypy
_mypy:
$(info [*] Python static type checker...)
mypy --junit-xml reports/typecheck.xml aws_iam_login
$(VERBOSE).SILENT: