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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# CarryCtx development commands
registry := "https://github.com/Xuepoo/carryctx"
# Install development dependencies
setup:
cargo fetch
lefthook install
# Run the CLI with arguments
dev *args:
cargo run -- {{args}}
# Build release binary
build:
cargo build --release
# Fast check: format + lint + check + test
check-fast:
cargo fmt --check
cargo clippy --workspace -- -D warnings
cargo check
cargo test --lib
# Full check: all quality gates
check:
cargo fmt --check
cargo clippy --workspace -- -D warnings
cargo check
cargo test
just markdownlint
cargo deny check
cargo audit
# CI pipeline (runs in CI)
ci:
just fmt-check
just lint
just typecheck
just test
just markdownlint
just actionlint
just package-smoke
# Type-check (alias for cargo check)
typecheck:
cargo check
# Lint with clippy
lint:
cargo clippy --workspace -- -D warnings
# Format code
fmt:
cargo fmt
# Check formatting
fmt-check:
cargo fmt --check
# Run tests
test:
cargo test
test-unit:
cargo test --lib
test-integration:
cargo test --test '*'
# Markdown linting
markdownlint:
markdownlint-cli2 "**/*.md" "#target" "#node_modules" "#.worktrees"
# GitHub Actions workflow linting (matches CI: shellcheck integration disabled)
actionlint:
actionlint -color -shellcheck=
# Security audit
audit:
cargo audit
deny:
cargo deny check
machete:
cargo machete
# Run the repository's available unused-dependency checker, if supported.
dependency-audit:
@set -eu; \
if command -v cargo-machete >/dev/null 2>&1; then \
cargo machete; \
else \
echo 'SKIP: cargo-machete unavailable; this Rust repository has no supported Knip-equivalent installed.'; \
fi
# Coverage
coverage:
cargo llvm-cov --all-features --html
# Package smoke test
package-smoke:
@set -eu; \
tmp=`mktemp -d`; trap 'rm -rf "$tmp"' EXIT; \
cargo package --locked --allow-dirty; \
package="target/package/carryctx-0.8.0.crate"; \
test -s "$package"; \
mkdir "$tmp/package"; \
tar -xzf "$package" -C "$tmp/package"; \
cargo install --locked --force --root "$tmp/root" --path "$tmp/package/carryctx-0.8.0"; \
binary="$tmp/root/bin/carryctx"; \
test -x "$binary"; \
version=`"$binary" --version`; \
test "$version" = "carryctx 0.8.0"
# Release verification
release-check:
just release-worktree-clean
just fmt-check
just lint
just typecheck
just test
just markdownlint
just actionlint
just dependency-audit
just package-smoke
@cargo metadata --no-deps --format-version 1 | jq -e '.packages[0].version == "0.8.0"' >/dev/null
@test -n "$$(awk '/^## \[0\.8\.0\]/{found=1} END{print found}' CHANGELOG.md)"
# Require a clean Git worktree before release verification.
release-worktree-clean:
@set -eu; \
if git diff-index --quiet HEAD -- && test -z "`git ls-files --others --exclude-standard`"; then \
exit 0; \
else \
echo 'ERROR: release-check requires a clean Git worktree.' >&2; \
git status --short >&2; \
exit 1; \
fi
# GitHub Actions local test
act:
act pull_request
# Clean build artifacts
clean:
cargo clean