# labkey-rs project justfile
# All repeating commands should be recipes here.
# Agents MUST read and use these recipes.
# Default recipe: show available commands
default:
@just --list
# choose recipes interactively
choose:
@just --choose
# === Development Workflow ===
# Run all pre-commit checks (required before committing)
check: fmt-check lint lint-default test doc-check
@echo "All checks passed"
# Run checks on all files (required before pushing)
check-all: fmt-check lint-all lint-default test-all doc-check
@echo "All checks passed on full codebase"
# === Formatting ===
# Check formatting without modifying files
fmt-check:
cargo fmt --all -- --check
# Apply formatting fixes
fmt:
cargo fmt --all
# === Linting ===
# Run clippy with deny warnings
lint:
cargo clippy --all-targets --all-features -- -D warnings
# Run clippy with default features only
lint-default:
cargo clippy --all-targets -- -D warnings
# Run clippy on all files
lint-all:
cargo clippy --all-targets --all-features -- -D warnings
# === Testing ===
# Run tests with nextest (--no-tests=pass allows empty test suites)
test:
cargo nextest run --all-features --no-tests=pass
# Run all tests including ignored
test-all:
cargo nextest run --all-features --run-ignored all --no-tests=pass
# Run tests with verbose output
test-verbose:
cargo nextest run --all-features --no-capture --no-tests=pass
# === Building ===
# Build debug
build:
cargo build
# Build release
build-release:
cargo build --release
# Check compilation without building
check-compile:
cargo check --all-targets --all-features
# === jj Workflow ===
# Since jj bypasses git hooks, use these recipes for enforcement.
# Prepare a commit: run all checks, then show status
prepare-commit: check
@echo ""
@echo "Ready to commit. Run: jj commit -m 'your message'"
@jj status
# Prepare for push: run full checks
prepare-push: check-all
@echo ""
@echo "Ready to push. Run: jj git push"
# Show current jj status
status:
jj status
# Show jj log
log:
jj log
# === Changelog ===
# Generate changelog from commit history (requires git-cliff)
changelog:
git cliff -o CHANGELOG.md
# Preview unreleased changelog entries
changelog-preview:
git cliff --unreleased
# === Utility ===
# Clean build artifacts
clean:
cargo clean
# Update dependencies
update:
cargo update
# === Documentation ===
# Check that documentation builds without errors
doc-check:
cargo doc --no-deps --document-private-items
# Generate and open documentation
doc:
cargo doc --no-deps --open
# Build the mdbook documentation site
book:
mdbook build book/
# Serve the mdbook site locally with live reload
book-serve:
mdbook serve book/ --open
# Clean the mdbook build output
book-clean:
mdbook clean book/
# Count source lines of code (excluding blanks and comments)
sloc:
@tokei --types=Rust --compact
# === Project Setup ===
# Full project setup for new clones (run this first!)
setup: clone-refs
@echo ""
@echo "Project setup complete!"
@echo "Reference repos: .agents/repos/labkey-api-js/ and .agents/repos/labkey-api-java/"
# === Reference Repositories ===
# Clone the upstream JS and Java clients for reference
clone-refs:
@echo "Cloning reference repositories into .agents/repos/..."
@mkdir -p .agents/repos
@echo "Cloning labkey-api-js (upstream JS/TS client)..."
git clone https://github.com/LabKey/labkey-api-js.git .agents/repos/labkey-api-js || echo "labkey-api-js already exists, skipping"
@echo "Cloning labkey-api-java (upstream Java client)..."
git clone https://github.com/LabKey/labkey-api-java.git .agents/repos/labkey-api-java || echo "labkey-api-java already exists, skipping"
@echo "Reference repositories cloned to .agents/repos/"
# Update reference repositories to latest
update-refs:
@echo "Updating reference repositories..."
cd .agents/repos/labkey-api-js && git pull || true
cd .agents/repos/labkey-api-java && git pull || true
@echo "Reference repositories updated"
# Remove reference repositories
clean-refs:
@echo "Removing reference repositories..."
rm -rf .agents/repos
@echo "Reference repositories removed"