# Justfile for recollect
# Install just: cargo install just

# List available recipes
default:
    @just --list

# Build the project
build:
    cargo build

# Build optimized release binary
release:
    cargo build --release

# Run tests
test:
    cargo test

# Run tests with output
test-verbose:
    cargo test -- --nocapture

# Run clippy linter
lint:
    cargo clippy --all-targets --all-features -- -D warnings

# Format code
fmt:
    cargo fmt --all

# Check formatting without modifying files
fmt-check:
    cargo fmt --all -- --check

# Run all checks (format, lint, test)
check: fmt-check lint test

# Install locally
install:
    cargo install --path .

# Clean build artifacts
clean:
    cargo clean

# Run the binary
run *ARGS:
    cargo run -- {{ARGS}}

# Watch for changes and rebuild
watch:
    cargo watch -x build

# Watch for changes and run tests
watch-test:
    cargo watch -x test

# Generate documentation
doc:
    cargo doc --open

# Run benchmarks
bench:
    cargo bench

# Check for security vulnerabilities
audit:
    cargo audit

# Update dependencies
update:
    cargo update

# Build for multiple targets
build-all-targets:
    cargo build --release --target x86_64-unknown-linux-gnu
    cargo build --release --target x86_64-pc-windows-gnu
    cargo build --release --target x86_64-apple-darwin

# Create a new release tag
release-tag VERSION:
    git tag -a v{{VERSION}} -m "Release version {{VERSION}}"
    git push origin v{{VERSION}}

# Run integration tests only
test-integration:
    cargo test --test integration_test

# Run code coverage
coverage:
    cargo tarpaulin --verbose --all-features --workspace --timeout 120

# Pre-commit checks
pre-commit: fmt lint test
    @echo "All checks passed! ✓"
