-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
38 lines (28 loc) · 1.02 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
# SPDX-FileCopyrightText: 2023 Technology Innovation Institute (TII)
#
# SPDX-License-Identifier: Apache-2.0
SHELL := bash
define target_success
@printf "\033[32m==> Target \"$(1)\" passed\033[0m\n\n"
endef
.DEFAULT_GOAL := help
TARGET: ## DESCRIPTION
@echo "TARGET is here only to provide the header for 'help'"
help: ## Show this help message
@grep -E '^[a-zA-Z_-]+:.*?##.*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}'
pre-push: test check ## Run tests and flake checks
$(call target_success,$@)
test: ## Run tests
pytest -vx tests/
$(call target_success,$@)
check: clean ## Nix flake check
nix --extra-experimental-features flakes flake check
clean: ## Remove build artifacts
find . -name '*.pyc' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +
find . -name '.eggs' -exec rm -rf {} +
rm -fr .pytest_cache/
$(call target_success,$@)
pristine: clean ## Pristine clean: remove all untracked files and folders
git clean -f -d -x
$(call target_success,$@)