-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
119 lines (91 loc) · 3.2 KB
/
justfile
File metadata and controls
119 lines (91 loc) · 3.2 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# DarkShell development commands
# Run `just --list` to see available recipes
set dotenv-load
# === CI Pipeline (matches GitHub Actions) ===
# Run the full CI pipeline locally
ci: check-fmt check-clippy build check-deny test test-doc
# === Check ===
# Check formatting (requires nightly)
check-fmt:
cargo +nightly fmt --all -- --check
# Run clippy lints
check-clippy:
cargo clippy --workspace --all-targets
# Check dependencies for advisories, licenses, bans
check-deny:
cargo deny check advisories licenses bans
# Run all checks
check: check-fmt check-clippy check-deny
# === Build ===
# Build all workspace crates
build:
cargo build --workspace
# Build release binary
build-release:
cargo build --workspace --release
# === Test ===
# Run all tests
test:
cargo test --workspace
# Run DarkShell-specific integration tests
test-darkshell:
cargo test -p darkshell-mcp -p darkshell-observe -p darkshell-blueprint --all-targets
cargo test -p openshell-cli --test 'darkshell_*'
# Run doc tests
test-doc:
cargo test --workspace --doc
# === Coverage ===
# Generate coverage report (HTML)
coverage:
cargo llvm-cov --workspace --html
@echo "Report: target/llvm-cov/html/index.html"
# Generate coverage report (JSON for CI)
coverage-json:
cargo llvm-cov --workspace --codecov --output-path codecov.json
# === Format ===
# Format all code
fmt:
cargo +nightly fmt --all
# === Fork Validation ===
# Verify fork integrity (crate names, no unsafe, binary name)
fork-check:
@echo "Checking crate names..."
@grep '^name = "openshell-' crates/openshell-*/Cargo.toml > /dev/null && echo "✓ Crate names match upstream"
@echo "Checking for unsafe in darkshell crates..."
@! grep -r 'unsafe ' crates/darkshell-*/src/ --include='*.rs' -l && echo "✓ No unsafe code in darkshell crates"
@echo "Checking binary name..."
@cargo build -p openshell-cli 2>/dev/null && test -f target/debug/darkshell && echo "✓ Binary named darkshell"
# === Release ===
# Generate changelog
[group('release')]
changelog:
git-cliff --config cliff.toml
# Show unreleased changes
[group('release')]
changelog-unreleased:
git-cliff --config cliff.toml --unreleased
# Prepare a release: bump version, generate changelog, commit, tag
[group('release')]
release version:
#!/usr/bin/env bash
set -euo pipefail
echo "Preparing release {{ version }}..."
# Update version in workspace Cargo.toml
sed -i '' "s/^version = \".*\"/version = \"{{ version }}\"/" Cargo.toml
cargo check
# Generate full changelog
git-cliff --config cliff.toml --tag "ds-v{{ version }}" -o CHANGELOG.md
git add Cargo.toml Cargo.lock CHANGELOG.md
git commit -m "chore(release): prepare v{{ version }}"
git tag -a "ds-v{{ version }}" -m "Release v{{ version }}"
echo ""
echo "✓ Release v{{ version }} prepared."
echo " Tag: ds-v{{ version }} (ds- prefix avoids upstream tag collision)"
echo " Push with: git push origin develop --tags"
# === Setup ===
# Install development tools
setup:
rustup component add clippy
rustup toolchain install nightly --component rustfmt
cargo install cargo-deny cargo-llvm-cov cargo-audit git-cliff
@echo "✓ All dev tools installed"