-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
97 lines (71 loc) · 3.25 KB
/
justfile
File metadata and controls
97 lines (71 loc) · 3.25 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
# kotoba — Immersive Japanese language learning CLI
# https://github.com/rararulab/kotoba
set dotenv-load := true
# Default: list available recipes
[private]
help:
@just --list --unsorted
# ─── Environment ──────────────────────────────────────────────────────
# Print environment info
env:
@echo "rustc: $(rustc --version)"
@echo "cargo: $(cargo --version)"
@echo "just: $(just --version)"
# ─── Format ───────────────────────────────────────────────────────────
# Format all code
fmt:
cargo +nightly fmt --all
# Check formatting (CI)
fmt-check:
cargo +nightly fmt --all --check
# ─── Lint ─────────────────────────────────────────────────────────────
# Run clippy
clippy:
cargo clippy --all-targets --all-features -- -D warnings
# Run all checks (compile)
check:
cargo check --all-targets --all-features
# Run all lints (clippy + doc + deny)
lint: clippy
cargo doc --no-deps --document-private-items 2>&1 | (! grep -E "^warning:" || (echo "Doc warnings found" && exit 1))
cargo deny check
# ─── Test ─────────────────────────────────────────────────────────────
# Run tests
test *ARGS:
cargo nextest run {{ ARGS }}
# ─── Build ────────────────────────────────────────────────────────────
# Build debug binary
build:
cargo build
mkdir -p bin
cp target/debug/kotoba bin/kotoba
# Build release binary
build-release:
cargo build --release
mkdir -p bin
cp target/release/kotoba bin/kotoba
# ─── Pre-commit ──────────────────────────────────────────────────────
# Run all pre-commit checks
pre-commit: fmt-check lint test
# Install git hooks via prek
setup-hooks:
prek install
# ─── Changelog & Release ─────────────────────────────────────────────
# Generate changelog (unreleased)
changelog:
git cliff --unreleased --strip header
# Generate full changelog
changelog-all:
git cliff
# Show what the next tag would be (based on conventional commits)
release-info:
@echo "Latest tag: $(git describe --tags --abbrev=0 2>/dev/null || echo 'none')"
@echo "Commits since tag: $(git rev-list $(git describe --tags --abbrev=0 2>/dev/null || git rev-list --max-parents=0 HEAD)..HEAD --count)"
# ─── Misc ─────────────────────────────────────────────────────────────
# Count lines of code
cloc:
tokei .
# Clean build artifacts
clean:
cargo clean
rm -rf bin