-
Notifications
You must be signed in to change notification settings - Fork 84
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (24 loc) · 1.07 KB
/
Makefile
File metadata and controls
31 lines (24 loc) · 1.07 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
.PHONY: lint lint-fix typecheck check
UV := uv
REPO_UV_CACHE_DIR := $(CURDIR)/.uv-cache
USE_REPO_UV_CACHE := $(shell cache_root="$${XDG_CACHE_HOME:-$$HOME/.cache}"; if [ -d "$$cache_root/uv" ]; then [ -w "$$cache_root/uv" ] && printf no || printf yes; elif [ -d "$$cache_root" ]; then [ -w "$$cache_root" ] && printf no || printf yes; elif [ -n "$$HOME" ] && [ -d "$$HOME" ]; then [ -w "$$HOME" ] && printf no || printf yes; else printf yes; fi)
ifeq ($(strip $(UV_CACHE_DIR)),)
ifeq ($(USE_REPO_UV_CACHE),yes)
UV_RUN_ENV := UV_CACHE_DIR=$(REPO_UV_CACHE_DIR)
endif
else
UV_RUN_ENV := UV_CACHE_DIR=$(UV_CACHE_DIR)
endif
UV_RUN := $(UV_RUN_ENV) $(UV) run --all-packages
RUN_LINT := $(UV_RUN) --group lint
RUN_TYPECHECK := $(UV_RUN) --group typecheck
RUFF := $(RUN_LINT) ruff
PYRIGHT := $(RUN_TYPECHECK) pyright
PYRIGHT_PATHS := apps/api/app apps/api/main.py apps/worker/app apps/worker/worker.py packages/shared-python/shared
lint:
$(RUFF) check apps packages
lint-fix:
$(RUFF) check --fix apps packages
typecheck:
$(PYRIGHT) --project pyproject.toml $(PYRIGHT_PATHS)
check: lint typecheck