-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.common
33 lines (23 loc) · 976 Bytes
/
Makefile.common
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
SHELL := /bin/bash
.DEFAULT_GOAL := help
.PHONY: autoformat
autoformat: ## runs black python formatter on this service's code. Use AFTER make install-*
# sort imports
@python3 -m isort --atomic -rc $(CURDIR)
# auto formatting with black
@python3 -m black --verbose \
--exclude "/(\.eggs|\.git|\.hg|\.mypy_cache|\.nox|\.tox|\.venv|\.svn|_build|buck-out|build|dist|migration|client-sdk|generated_code)/" \
$(CURDIR)
# cleanup unused imports
@pycln --all $(CURDIR)
# CLEAN
.PHONY: clean .check-clean
.check-clean:
@git clean -ndxf -e .vscode/
@echo -n "$(shell whoami) are you sure? [y/N] " && read ans && [ $${ans:-N} = y ]
clean:.check-clean ## Cleans all unversioned files in project
@git clean -dxf -e .vscode/
# HELP
.PHONY: help
help: ## This nice help (thanks to https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html)
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)