.PHONY: build check test fmt fmt-check lint clippy run clean set-version build-release coverage
build:
cargo build
build-release:
cargo build --release
check:
cargo check
test:
cargo test --all-features
fmt:
cargo fmt
fmt-check:
cargo fmt --check
lint: clippy
clippy-check:
cargo clippy --all-targets --all-features -- -D warnings
run:
cargo run
coverage:
cargo test --no-run
mkdir -p target/cov
for file in target/debug/deps/*-*; do \
[ -x "$${file}" ] || continue; \
[ "$${file}" = "$${file%.d}" ] || continue; \
mkdir -p "target/cov/$$(basename $$file)"; \
kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$$(basename $$file)" "$$file" || true; \
done
clean:
cargo clean
set-version:
@if [ -z "$(VERSION)" ]; then \
echo "Error: VERSION is required. Usage: make set-version VERSION=1.2.3"; \
exit 1; \
fi
cargo install cargo-edit@0.12.3 --quiet --locked
cargo set-version $(VERSION)
cargo update --workspace
@echo "Version set to $(VERSION) and Cargo.lock updated"
init:
cargo run -- --config test-config.toml init init --force
init-noforce:
cargo run -- --config test-config.toml init init
index:
cargo run -- --config test-config.toml index index
index-verbose:
cargo run -- --config test-config.toml index index --verbose
index-force:
cargo run -- --config test-config.toml index index --force
search:
cargo run -- --config test-config.toml query search "$(QUERY)"
search-limit:
cargo run -- --config test-config.toml query search "$(QUERY)" --limit 10
backlinks:
cargo run -- --config test-config.toml query backlinks "$(NOTE)"
links:
cargo run -- --config test-config.toml query links "$(NOTE)"
unresolved:
cargo run -- --config test-config.toml query unresolved
tags:
cargo run -- --config test-config.toml query tags
tags-list:
cargo run -- --config test-config.toml query tags --list
tags-specific:
cargo run -- --config test-config.toml query tags "$(TAG)"
bloat:
cargo run -- --config test-config.toml analyze bloat
bloat-threshold:
cargo run -- --config test-config.toml analyze bloat --threshold 50000
related:
cargo run -- --config test-config.toml analyze related "$(NOTE)"
related-limit:
cargo run -- --config test-config.toml analyze related "$(NOTE)" --limit 5
diagnose-orphans:
cargo run -- --config test-config.toml diagnose orphans
diagnose-orphans-no-templates:
cargo run -- --config test-config.toml diagnose orphans --exclude-templates
diagnose-orphans-full:
cargo run -- --config test-config.toml diagnose orphans --exclude-templates --exclude-daily
diagnose-broken-links:
cargo run -- --config test-config.toml diagnose broken-links
stats:
cargo run -- --config test-config.toml view stats
describe:
cargo run -- --config test-config.toml view describe "$(NOTE)"
search-json:
cargo run -- --output json --config test-config.toml query search "$(QUERY)"
backlinks-json:
cargo run -- --output json --config test-config.toml query backlinks "$(NOTE)"
links-json:
cargo run -- --output json --config test-config.toml query links "$(NOTE)"
unresolved-json:
cargo run -- --output json --config test-config.toml query unresolved
tags-json:
cargo run -- --output json --config test-config.toml query tags
tags-list-json:
cargo run -- --output json --config test-config.toml query tags --list
bloat-json:
cargo run -- --output json --config test-config.toml analyze bloat
related-json:
cargo run -- --output json --config test-config.toml analyze related "$(NOTE)"
orphans-json:
cargo run -- --output json --config test-config.toml diagnose orphans
broken-links-json:
cargo run -- --output json --config test-config.toml diagnose broken-links
stats-json:
cargo run -- --output json --config test-config.toml view stats
describe-json:
cargo run -- --output json --config test-config.toml view describe "$(NOTE)"