Improve Makefile targets

This commit is contained in:
Hassan Abedi 2026-05-29 15:06:44 +02:00
parent 9ef8db2d08
commit 7f8053d980
4 changed files with 23 additions and 22 deletions

View File

@ -19,24 +19,24 @@ repos:
- repo: local
hooks:
- id: cargo-fmt-check
name: Check Rust Formatting
entry: make fmt-check
- id: format
name: Check Code Formatting
entry: make format
language: system
pass_filenames: false
files: \.rs$
stages: [ pre-commit ]
- id: cargo-clippy
name: Run Clippy
entry: make clippy
- id: lint
name: Run Linters
entry: make lint
language: system
pass_filenames: false
files: \.rs$
stages: [ pre-commit ]
- id: cargo-test
name: Run Rust Tests
- id: check
name: Run All Checks
entry: make check
language: system
pass_filenames: false

View File

@ -232,8 +232,8 @@ The `Makefile` wraps the standard Rust commands and skips Rust checks with a cle
For Rust changes, prefer:
1. `make fmt-check`
2. `make clippy`
1. `make format-check`
2. `make lint`
3. `make test`
These map to `cargo fmt --all --check`, `cargo clippy --all-targets --all-features -- -D warnings`, and `cargo test --all-targets --all-features`.
@ -299,8 +299,8 @@ Use this review format:
Suggested PR checklist:
- [ ] `make fmt-check` passes, if applicable
- [ ] `make clippy` passes, if applicable
- [ ] `make format-check` passes, if applicable
- [ ] `make lint` passes, if applicable
- [ ] `make test` passes, if applicable
- [ ] Snapshot oracle or expected output included for planner behavior
- [ ] Unsupported cases documented

View File

@ -9,40 +9,40 @@ help: ## Show help messages for all available targets
@grep -E '^[a-zA-Z_-]+:.*## .*$$' Makefile | \
awk 'BEGIN {FS = ":.*## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
.PHONY: fmt
fmt: ## Format Rust code
.PHONY: format
format: ## Apply code formatting
@if [ -z "$(HAS_CARGO)" ]; then \
echo "No Cargo.toml found. Skipping Rust formatting."; \
else \
cargo fmt --all; \
fi
.PHONY: fmt-check
fmt-check: ## Check Rust formatting
.PHONY: format-check
format-check: ## Check code formatting without applying changes
@if [ -z "$(HAS_CARGO)" ]; then \
echo "No Cargo.toml found. Skipping Rust format check."; \
else \
cargo fmt --all --check; \
fi
.PHONY: clippy
clippy: ## Run Clippy for all targets and features
.PHONY: lint
lint: ## Run linters across all targets and features
@if [ -z "$(HAS_CARGO)" ]; then \
echo "No Cargo.toml found. Skipping Clippy."; \
echo "No Cargo.toml found. Skipping lint."; \
else \
cargo clippy --all-targets --all-features -- -D warnings; \
fi
.PHONY: test
test: ## Run Rust tests for all targets and features
test: ## Run tests across all targets and features
@if [ -z "$(HAS_CARGO)" ]; then \
echo "No Cargo.toml found. Skipping Rust tests."; \
echo "No Cargo.toml found. Skipping tests."; \
else \
cargo test --all-targets --all-features; \
fi
.PHONY: check
check: fmt-check clippy test ## Run all Rust checks
check: format-check lint test ## Run all checks (format-check, lint, test)
.PHONY: clean
clean: ## Remove build output

View File

@ -3,6 +3,7 @@
This demo shows how to store and read data from Geomerge.
The demo:
1. loads the compiled `paths.json` schema,
2. creates a Geomerge store,
3. inserts a small graph dataset in one transaction,