Improve Makefile targets
This commit is contained in:
parent
9ef8db2d08
commit
7f8053d980
@ -19,24 +19,24 @@ repos:
|
|||||||
|
|
||||||
- repo: local
|
- repo: local
|
||||||
hooks:
|
hooks:
|
||||||
- id: cargo-fmt-check
|
- id: format
|
||||||
name: Check Rust Formatting
|
name: Check Code Formatting
|
||||||
entry: make fmt-check
|
entry: make format
|
||||||
language: system
|
language: system
|
||||||
pass_filenames: false
|
pass_filenames: false
|
||||||
files: \.rs$
|
files: \.rs$
|
||||||
stages: [ pre-commit ]
|
stages: [ pre-commit ]
|
||||||
|
|
||||||
- id: cargo-clippy
|
- id: lint
|
||||||
name: Run Clippy
|
name: Run Linters
|
||||||
entry: make clippy
|
entry: make lint
|
||||||
language: system
|
language: system
|
||||||
pass_filenames: false
|
pass_filenames: false
|
||||||
files: \.rs$
|
files: \.rs$
|
||||||
stages: [ pre-commit ]
|
stages: [ pre-commit ]
|
||||||
|
|
||||||
- id: cargo-test
|
- id: check
|
||||||
name: Run Rust Tests
|
name: Run All Checks
|
||||||
entry: make check
|
entry: make check
|
||||||
language: system
|
language: system
|
||||||
pass_filenames: false
|
pass_filenames: false
|
||||||
|
|||||||
@ -232,8 +232,8 @@ The `Makefile` wraps the standard Rust commands and skips Rust checks with a cle
|
|||||||
|
|
||||||
For Rust changes, prefer:
|
For Rust changes, prefer:
|
||||||
|
|
||||||
1. `make fmt-check`
|
1. `make format-check`
|
||||||
2. `make clippy`
|
2. `make lint`
|
||||||
3. `make test`
|
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`.
|
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:
|
Suggested PR checklist:
|
||||||
|
|
||||||
- [ ] `make fmt-check` passes, if applicable
|
- [ ] `make format-check` passes, if applicable
|
||||||
- [ ] `make clippy` passes, if applicable
|
- [ ] `make lint` passes, if applicable
|
||||||
- [ ] `make test` passes, if applicable
|
- [ ] `make test` passes, if applicable
|
||||||
- [ ] Snapshot oracle or expected output included for planner behavior
|
- [ ] Snapshot oracle or expected output included for planner behavior
|
||||||
- [ ] Unsupported cases documented
|
- [ ] Unsupported cases documented
|
||||||
|
|||||||
20
Makefile
20
Makefile
@ -9,40 +9,40 @@ help: ## Show help messages for all available targets
|
|||||||
@grep -E '^[a-zA-Z_-]+:.*## .*$$' Makefile | \
|
@grep -E '^[a-zA-Z_-]+:.*## .*$$' Makefile | \
|
||||||
awk 'BEGIN {FS = ":.*## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
|
awk 'BEGIN {FS = ":.*## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
|
||||||
|
|
||||||
.PHONY: fmt
|
.PHONY: format
|
||||||
fmt: ## Format Rust code
|
format: ## Apply code formatting
|
||||||
@if [ -z "$(HAS_CARGO)" ]; then \
|
@if [ -z "$(HAS_CARGO)" ]; then \
|
||||||
echo "No Cargo.toml found. Skipping Rust formatting."; \
|
echo "No Cargo.toml found. Skipping Rust formatting."; \
|
||||||
else \
|
else \
|
||||||
cargo fmt --all; \
|
cargo fmt --all; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
.PHONY: fmt-check
|
.PHONY: format-check
|
||||||
fmt-check: ## Check Rust formatting
|
format-check: ## Check code formatting without applying changes
|
||||||
@if [ -z "$(HAS_CARGO)" ]; then \
|
@if [ -z "$(HAS_CARGO)" ]; then \
|
||||||
echo "No Cargo.toml found. Skipping Rust format check."; \
|
echo "No Cargo.toml found. Skipping Rust format check."; \
|
||||||
else \
|
else \
|
||||||
cargo fmt --all --check; \
|
cargo fmt --all --check; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
.PHONY: clippy
|
.PHONY: lint
|
||||||
clippy: ## Run Clippy for all targets and features
|
lint: ## Run linters across all targets and features
|
||||||
@if [ -z "$(HAS_CARGO)" ]; then \
|
@if [ -z "$(HAS_CARGO)" ]; then \
|
||||||
echo "No Cargo.toml found. Skipping Clippy."; \
|
echo "No Cargo.toml found. Skipping lint."; \
|
||||||
else \
|
else \
|
||||||
cargo clippy --all-targets --all-features -- -D warnings; \
|
cargo clippy --all-targets --all-features -- -D warnings; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test: ## Run Rust tests for all targets and features
|
test: ## Run tests across all targets and features
|
||||||
@if [ -z "$(HAS_CARGO)" ]; then \
|
@if [ -z "$(HAS_CARGO)" ]; then \
|
||||||
echo "No Cargo.toml found. Skipping Rust tests."; \
|
echo "No Cargo.toml found. Skipping tests."; \
|
||||||
else \
|
else \
|
||||||
cargo test --all-targets --all-features; \
|
cargo test --all-targets --all-features; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
.PHONY: check
|
.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
|
.PHONY: clean
|
||||||
clean: ## Remove build output
|
clean: ## Remove build output
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
This demo shows how to store and read data from Geomerge.
|
This demo shows how to store and read data from Geomerge.
|
||||||
|
|
||||||
The demo:
|
The demo:
|
||||||
|
|
||||||
1. loads the compiled `paths.json` schema,
|
1. loads the compiled `paths.json` schema,
|
||||||
2. creates a Geomerge store,
|
2. creates a Geomerge store,
|
||||||
3. inserts a small graph dataset in one transaction,
|
3. inserts a small graph dataset in one transaction,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user