README, CONTRIBUTING and Makefile

This commit is contained in:
Harivansh Rathi 2026-03-25 19:06:11 -04:00
parent 8ca33ae1e2
commit 47592911b9
3 changed files with 135 additions and 0 deletions

33
Makefile Normal file
View file

@ -0,0 +1,33 @@
.PHONY: fmt fmt-check lint test-unit test-integration site-format-check validate
fmt:
cargo fmt --all
fmt-check:
cargo fmt --all --check
lint:
cargo clippy --all-targets -- -D warnings
test-unit:
cargo test --lib
test-integration:
@if [ "$$(uname -s)" != "Linux" ]; then \
echo "Integration tests require Linux and xvfb-run."; \
exit 1; \
fi
@if ! command -v xvfb-run >/dev/null 2>&1; then \
echo "xvfb-run is required to execute integration tests."; \
exit 1; \
fi
XDG_SESSION_TYPE=x11 xvfb-run -a cargo test --test x11_runtime -- --test-threads=1
site-format-check:
@if ! command -v pnpm >/dev/null 2>&1; then \
echo "pnpm is required for site formatting checks."; \
exit 1; \
fi
pnpm --dir site format:check
validate: fmt-check lint test-unit test-integration site-format-check