-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
99 lines (76 loc) · 2.83 KB
/
justfile
File metadata and controls
99 lines (76 loc) · 2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Heimdall — PTY session supervisor
# Usage: just <recipe>
# Default: list recipes
default:
@just --list
# ─── Build ─────────────────────────────────────────────────────────
# Build (debug)
build:
cargo build
# Build (release)
release:
cargo build --release
# Install to ~/.local/bin
install: release
cp target/release/hm ~/.local/bin/hm
@echo "hm installed to ~/.local/bin/hm"
# ─── Quality ───────────────────────────────────────────────────────
# Run all checks (clippy + fmt check + full test suite)
check: clippy fmt-check test-all
# Run unit + Rust integration tests
test *args:
cargo test {{ args }}
# Run Python attach tests
test-attach: build
uv run pytest tests/ -v
# Run full integration suite (Rust + Python attach tests)
test-all: test test-attach
# Run tests with coverage (requires cargo-llvm-cov + uv)
# Mirrors the CI coverage workflow exactly.
cov:
#!/usr/bin/env bash
set -euo pipefail
source <(cargo llvm-cov show-env --sh)
cargo llvm-cov clean --workspace
cargo build
cargo test
HM_BIN="$(pwd)/target/debug/hm" uv run pytest tests/ -v
cargo llvm-cov report --lcov --output-path lcov.info
cargo llvm-cov report --summary-only
# Lint with clippy
clippy:
cargo clippy -- -W clippy::all
# Check formatting
fmt-check:
cargo fmt -- --check
# Format code
fmt:
cargo fmt
# ─── Run ───────────────────────────────────────────────────────────
# Launch a supervised session
run id +cmd:
cargo run -- run --id {{ id }} -- {{ cmd }}
# Attach to a session
attach id:
cargo run -- attach {{ id }}
# List sessions
ls:
cargo run -- ls
# Session status
status id:
cargo run -- status {{ id }}
# Kill a session
kill id:
cargo run -- kill {{ id }}
# ─── Dev ───────────────────────────────────────────────────────────
# Check dependencies
doctor:
@echo "Checking dependencies..."
@which cargo >/dev/null 2>&1 && echo " cargo: $(cargo --version)" || echo " cargo: MISSING"
@which just >/dev/null 2>&1 && echo " just: $(just --version)" || echo " just: MISSING"
@which uv >/dev/null 2>&1 && echo " uv: $(uv --version)" || echo " uv: MISSING (needed for Python attach tests)"
@which cargo-llvm-cov >/dev/null 2>&1 && echo " cargo-llvm-cov: ok" || echo " cargo-llvm-cov: MISSING (optional, for coverage)"
@echo "Done."
# Clean build artifacts
clean:
cargo clean