forked from yankeexe/good-first-issues
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (33 loc) · 965 Bytes
/
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
SHELL :=/bin/bash
CWD := $(PWD)
TMP_PATH := $(CWD)/.tmp
VENV_PATH := $(CWD)/venv
docker_image := good-first-issues
.PHONY: test clean
.DEFAULT_GOAL := help
build: # Build Docker image for CLI
@docker build -t $(docker_image) .
build.if:
@if [ "$$(docker images -q $(docker_image) 2> /dev/null)" = "" ]; then \
$(MAKE) -s build; \
fi
clean: # Clean cache files
@rm -rf $(TMP_PATH) __pycache__ .pytest_cache
@find . -name '*.pyc' -delete
@find . -name '__pycache__' -delete
test: # Run pytest
@pytest -vvv
venv: # Create a virtual environment
@python3 -m venv venv
format: # Format code base with black
@black .
check: # Check for formatting issues with black
@black --check --diff .
setup: # Setup local development environment
@pip install -e .[dev]
lint: # Run linters
black .
isort .
flake8
help: # Show this help
@egrep -h '\s#\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?# "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'