-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
172 lines (130 loc) · 5.03 KB
/
Copy pathMakefile
File metadata and controls
172 lines (130 loc) · 5.03 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
.PHONY: help install dev build frontend schemas blogs books communities events packages package-ingest package-publish package-conan package-meson package-spack package-vcpkg package-matches youtube serve clean format format-python format-templates format-makefile format-assets format-frontend format-yaml check-format check-format-python check-format-templates check-format-makefile check-format-assets check-format-frontend check-format-yaml lint lint-python lint-templates lint-makefile lint-frontend test test-frontend
ID_ARG = $(if $(ID),--id $(ID),)
PYTHON_PATHS = updater/src updater/tests schemas scripts site_plugins
help:
@echo "C++ Social - Development Commands"
@echo ""
@echo "Available targets:"
@echo " make install - Install the updater and generator"
@echo " make build - Build the site"
@echo " make dev - Watch, rebuild, and serve the site"
@echo " make schemas - Generate JSON Schemas"
@echo " make update-all - Update all metadata"
@echo " make blogs - Refresh blog metadata and posts (optional ID=source-id)"
@echo " make books - Refresh book metadata (optional ID=isbn)"
@echo " make communities - Refresh community metadata (optional ID=community-id)"
@echo " make events - Refresh public event imports"
@echo " make packages - Refresh the package catalog"
@echo " make package-ingest - Refresh manager catalogs without publishing"
@echo " make package-publish - Publish from saved manager catalogs"
@echo " make package-conan - Refresh the Conan catalog"
@echo " make package-meson - Refresh the Meson catalog"
@echo " make package-spack - Refresh the Spack catalog"
@echo " make package-vcpkg - Refresh the vcpkg catalog"
@echo " make package-matches - Recalculate package matches"
@echo " make youtube - Refresh YouTube metadata and videos (optional ID=channel-id)"
@echo " make serve - Build and serve the site"
@echo " make clean - Clean build artifacts"
@echo " make format - Auto-format source files"
@echo " make check-format - Check formatting without changing files"
@echo " make lint - Run source linters and validators"
@echo " make test - Run unit tests"
install:
python3 -m pip install -r requirements.txt
python3 -m pip install -r requirements_dev.txt
npm ci
dev:
site-generator develop --host 0.0.0.0
build:
site-generator build
frontend:
npm run build:frontend -- --outdir=build
schemas:
site-generator schemas
blogs:
meta-updater blogs all $(ID_ARG)
books:
meta-updater books $(ID_ARG)
communities:
meta-updater communities $(ID_ARG)
events:
meta-updater events
packages:
meta-updater packages --refresh
package-ingest:
meta-updater packages --refresh ingest
package-publish:
meta-updater packages publish
package-conan:
meta-updater packages --manager conan
package-meson:
meta-updater packages --manager meson
package-spack:
meta-updater packages --manager spack
package-vcpkg:
meta-updater packages --manager vcpkg
package-matches:
meta-updater packages matches
youtube:
meta-updater youtube all $(ID_ARG)
update-all: blogs books communities events packages youtube
serve: build
python3 -m http.server --directory build 1313
clean:
rm -rf build
format-python:
python3 -m autopep8 --in-place --recursive --max-line-length 88 $(PYTHON_PATHS)
check-format-python:
@python3 -m autopep8 --diff --exit-code --recursive --max-line-length 88 $(PYTHON_PATHS) || { \
status=$$?; \
echo ""; \
echo "Python formatting check failed. Apply the diff with: make format-python"; \
exit $$status; \
}
lint-python:
python3 -m ruff check $(PYTHON_PATHS)
python3 -m compileall -q $(PYTHON_PATHS)
test-python:
PYTHONPATH=updater/src python3 -m unittest discover -s updater/tests -v
python3 -m unittest discover -s scripts/tests -v
format-templates:
@djlint --reformat --profile=jinja templates/ || test $$? -eq 1
check-format-templates:
@djlint --check --profile=jinja templates/ || { \
status=$$?; \
echo "Template formatting check failed. Run: make format-templates"; \
exit $$status; \
}
lint-templates:
djlint --lint --profile=jinja --ignore=H021 templates/
format-makefile:
mbake format Makefile
check-format-makefile:
@mbake format --check --diff Makefile || { \
status=$$?; \
echo "Makefile formatting check failed. Run: make format-makefile"; \
exit $$status; \
}
lint-makefile:
mbake validate Makefile
format-assets:
npm run format:assets
check-format-assets:
npm run check:assets
format-yaml:
npm run format:yaml
check-format-yaml:
npm run check:yaml
format-frontend:
npm run format:frontend
check-format-frontend:
npm run check:frontend
lint-frontend:
npm run lint:frontend
npm run typecheck:frontend
test-frontend:
npm run test:frontend
check-format: check-format-python check-format-templates check-format-makefile check-format-assets check-format-frontend check-format-yaml
format: format-python format-templates format-makefile format-assets format-frontend format-yaml
lint: lint-python lint-templates lint-makefile lint-frontend
test: test-python test-frontend