-
Notifications
You must be signed in to change notification settings - Fork 86
Expand file tree
/
Copy pathjustfile
More file actions
125 lines (102 loc) · 3.12 KB
/
justfile
File metadata and controls
125 lines (102 loc) · 3.12 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
120
121
122
123
124
125
# Rust project checks
set positional-arguments
set shell := ["bash", "-euo", "pipefail", "-c"]
# List available commands
default:
@just --list
# Run all checks via three parallel pipelines
[parallel]
check: _rust-pipeline _python-pipeline docs-check
# Run check and fail if there are uncommitted changes (for CI)
check-ci: check
#!/usr/bin/env bash
set -euo pipefail
if ! git diff --quiet || ! git diff --cached --quiet; then
echo "Error: check caused uncommitted changes"
echo "Run 'just check' locally and commit the results"
git diff --stat
exit 1
fi
# Rust: format → clippy → test (sequential)
_rust-pipeline: format-rust clippy unit-tests
# Python: format → lint → typecheck (sequential)
_python-pipeline: format-python ruff-check pyright
# Format Rust and Python files
format: format-rust format-python
# Format Rust files
format-rust:
@cargo fmt --all
# Format Python test files
format-python:
@ruff format tests --quiet
# Auto-fix clippy warnings, then fail on any remaining
clippy:
@cargo clippy --fix --allow-dirty --quiet -- -D clippy::all 2>&1 | { grep -v "^0 errors" || true; }
# Build the project
build:
cargo build --all
# Install release binary globally
install:
cargo install --offline --path . --locked
# Install debug binary globally via symlink
install-dev:
cargo build && ln -sf $(pwd)/target/debug/workmux ~/.cargo/bin/workmux
# Run unit tests
unit-tests:
#!/usr/bin/env bash
set -euo pipefail
output=$(cargo test --bin workmux --quiet 2>&1) || { echo "$output"; exit 1; }
echo "$output" | tail -1
# Run ruff linter on Python tests
ruff-check:
@ruff check tests --fix --quiet
# Run pyright type checker on Python tests
pyright:
#!/usr/bin/env bash
set -euo pipefail
source tests/venv/bin/activate
output=$(pyright tests 2>&1) || { echo "$output"; exit 1; }
echo "$output" | grep -v "^0 errors" || true
# Check that all docs pages have meta descriptions
docs-check:
#!/usr/bin/env bash
set -euo pipefail
missing=()
while IFS= read -r file; do
if ! head -20 "$file" | grep -q '^description:'; then
missing+=("$file")
fi
done < <(find docs -name "*.md" -not -path "*/node_modules/*" -not -path "docs/README.md")
if [ ${#missing[@]} -gt 0 ]; then
echo "Missing meta description in:"
printf ' %s\n' "${missing[@]}"
exit 1
fi
# Run the application
run *ARGS:
cargo run -- "$@"
# Run Python tests in parallel (depends on build)
test *ARGS: build
#!/usr/bin/env bash
set -euo pipefail
source tests/venv/bin/activate
export WORKMUX_TEST=1
quiet_flag=""
[[ -n "${CLAUDECODE:-}" ]] && quiet_flag="-q"
if [ $# -eq 0 ]; then
pytest tests/ -n auto $quiet_flag
else
pytest $quiet_flag "$@"
fi
# Run docs dev server
docs:
cd docs && npm install && npm run dev -- --open
# Format documentation files
format-docs:
cd docs && npm run format
# Release a new patch version
release *ARGS:
@just _release patch {{ARGS}}
# Internal release helper
_release bump *ARGS:
@cargo-release {{bump}} {{ARGS}}