-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
71 lines (61 loc) · 2.24 KB
/
Makefile
File metadata and controls
71 lines (61 loc) · 2.24 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
PROJECT=starcraft_stats
JS_SOURCES := html/js/
BIOME=npm exec --package=@biomejs/biome@1.9.4 -- biome # renovate: datasource=npm depName=@biomejs/biome
# Define when more than the main package tree requires coverage
# like is the case for snapcraft (snapcraft and snapcraft_legacy):
# COVERAGE_SOURCE="starcraft"
UV_TEST_GROUPS := "--group=dev"
UV_LINT_GROUPS := "--group=lint" "--group=types"
UV_TICS_GROUPS := "--group=tics"
# If you have dev dependencies that depend on your distro version, uncomment these:
# ifneq ($(wildcard /etc/os-release),)
# include /etc/os-release
# endif
# ifdef VERSION_CODENAME
# UV_TEST_GROUPS += "--group=dev-$(VERSION_CODENAME)"
# UV_LINT_GROUPS += "--group=dev-$(VERSION_CODENAME)"
# UV_TICS_GROUPS += "--group=dev-$(VERSION_CODENAME)"
# endif
include common.mk
.PHONY: format
format: format-ruff format-codespell format-prettier format-biome format-pre-commit ## Run all automatic formatters
.PHONY: lint
lint: lint-ruff lint-ty lint-codespell lint-prettier lint-biome lint-shellcheck lint-twine lint-uv-lockfile ## Run all linters
.PHONY: format-biome
format-biome: install-npm ##- Automatically format JavaScript with biome
$(BIOME) format --write $(JS_SOURCES)
.PHONY: lint-biome
lint-biome: install-npm ##- Lint JavaScript with biome
ifneq ($(CI),)
@echo ::group::$@
endif
$(BIOME) lint $(JS_SOURCES)
ifneq ($(CI),)
@echo ::endgroup::
endif
.PHONY: pack
pack: pack-pip ## Build all packages
# Find dependencies that need installing
APT_PACKAGES :=
ifeq ($(wildcard /usr/include/libxml2/libxml/xpath.h),)
APT_PACKAGES += libxml2-dev
endif
ifeq ($(wildcard /usr/include/libxslt/xslt.h),)
APT_PACKAGES += libxslt1-dev
endif
ifeq ($(wildcard /usr/share/doc/python3-venv/copyright),)
APT_PACKAGES += python3-venv
endif
# Used for installing build dependencies in CI.
.PHONY: install-build-deps
install-build-deps: install-lint-build-deps
ifeq ($(APT_PACKAGES),)
else ifeq ($(shell which apt-get),)
$(warning Cannot install build dependencies without apt.)
$(warning Please ensure the equivalents to these packages are installed: $(APT_PACKAGES))
else
sudo $(APT) install $(APT_PACKAGES)
endif
# If additional build dependencies need installing in order to build the linting env.
.PHONY: install-lint-build-deps
install-lint-build-deps: