Skip to content

Commit b98a154

Browse files
author
Luca Valentini
authored
Add Makefile (#4)
* Add Makefile * Add make setup
1 parent b3b89c1 commit b98a154

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

Makefile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
.PHONY: setup
3+
setup: ## Create a virtual environment for the project and installs all dependencies
4+
poetry install
5+
6+
.PHONY: format
7+
format: ## Automatically format the .py files with Black and Isort
8+
poetry run isort --recursive .
9+
poetry run black .
10+
11+
.PHONY: lint
12+
lint: ## Check the .py files with Mypy, Flake8 and Black
13+
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
14+
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics
15+
poetry run black --check .
16+
poetry run mypy --ignore-missing-imports --disallow-untyped-defs .
17+
18+
.PHONY: tests
19+
tests: ## Run tests with pytest and create the coverage report
20+
poetry run pytest --cov=./ --cov-report=xml
21+
22+
.SILENT: help
23+
help: ## Shows all available commands
24+
set -x
25+
echo "Usage: make [target]"
26+
echo ""
27+
echo "Available targets:"
28+
grep ':.* ##\ ' ${MAKEFILE_LIST} | awk '{gsub(":[^#]*##","\t"); print}' | column -t -c 2 -s $$'\t'| sort

0 commit comments

Comments
 (0)