-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (35 loc) · 1.33 KB
/
Copy pathMakefile
File metadata and controls
47 lines (35 loc) · 1.33 KB
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
SHELL := /bin/bash
.SHELLFLAGS := -norc -euo pipefail -c
.DEFAULT_GOAL := help
.PHONY: all
all: lint test ## Run all checks
.PHONY: lint lint-ruff lint-ruff-format lint-ruff-problems lint-basedpyright
lint: lint-ruff lint-basedpyright ## Lint problems in sources
lint-ruff: lint-ruff-format lint-ruff-problems ## Check python with ruff
lint-ruff-format: ## Validate python formatting
# validate python formatting, 'make -k fix' will address issues
uv run ruff format --diff
lint-ruff-problems: ## Check python for problems
# check python for problems, 'make -k fix' may address some issues
uv run ruff check
lint-basedpyright: ## Type-check python with basedpyright
# check python types
uv run basedpyright
# Autofixing
.PHONY: fix fix-ruff fix-ruff-format fix-ruff-problems
fix: fix-ruff ## Fix problems in sources
.NOPARALLEL: fix-ruff
fix-ruff: fix-ruff-problems fix-ruff-format ## Fix python with ruff
fix-ruff-format: ## Fix python formatting
# reformat python sources
uv run ruff format
fix-ruff-problems: ## Fix python problems
# autofix python sources: safe fixes only
uv run ruff check --fix
# Testing
.PHONY: test
test: ## Run tests
uv run pytest
.PHONY: help
help: ## Display this help screen
@grep -E '^[a-z.A-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'