mirror of
https://github.com/Xevion/Pac-Man.git
synced 2026-01-31 02:25:04 -06:00
refactor(just): split monolithic Justfile into project-specific modules
Organize recipes into dedicated Justfiles for pacman, server, and web components. Root Justfile now serves as a thin facade with common aliases pointing to submodule recipes.
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
set shell := ["bash", "-c"]
|
||||
|
||||
binary_extension := if os() == "windows" { ".exe" } else { "" }
|
||||
|
||||
# Run the game, pass args (e.g., `just pacman::run -r` for release)
|
||||
run *args:
|
||||
cargo run -p pacman {{args}}
|
||||
|
||||
# Run all checks (clippy for desktop + wasm, warns on format)
|
||||
check:
|
||||
@echo "Checking format..."
|
||||
@cargo fmt --all -- --check || echo "⚠ Format issues detected (run \`just format\` to fix)"
|
||||
@echo "Running clippy for desktop target..."
|
||||
@cargo clippy --all-targets --all-features --quiet -- -D warnings
|
||||
@echo "Running clippy for wasm target..."
|
||||
@cargo clippy -p pacman --target wasm32-unknown-emscripten --all-targets --all-features --quiet -- -D warnings
|
||||
@echo "Running frontend checks..."
|
||||
@bun run --cwd web check
|
||||
@bun run --cwd web lint
|
||||
@echo "All checks passed!"
|
||||
|
||||
# Run tests with nextest
|
||||
test:
|
||||
cargo nextest run --no-fail-fast
|
||||
|
||||
# Auto-format code
|
||||
format:
|
||||
cargo fmt --all
|
||||
|
||||
# Fix linting errors & formatting
|
||||
fix:
|
||||
cargo fix --workspace --lib --allow-dirty
|
||||
cargo fmt --all
|
||||
|
||||
# Profile using samply
|
||||
samply:
|
||||
cargo build --profile profile
|
||||
samply record ./target/profile/pacman{{binary_extension}}
|
||||
|
||||
# Generate baseline LCOV report
|
||||
coverage:
|
||||
cargo +nightly llvm-cov \
|
||||
--lcov \
|
||||
--remap-path-prefix \
|
||||
--workspace \
|
||||
--output-path lcov.info \
|
||||
--profile coverage \
|
||||
--no-fail-fast nextest
|
||||
|
||||
# Display coverage report
|
||||
report-coverage: coverage
|
||||
cargo llvm-cov report --remap-path-prefix
|
||||
|
||||
# Open HTML coverage report
|
||||
html: coverage
|
||||
cargo llvm-cov report \
|
||||
--remap-path-prefix \
|
||||
--html \
|
||||
--open
|
||||
Reference in New Issue
Block a user