-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
60 lines (53 loc) · 1.38 KB
/
justfile
File metadata and controls
60 lines (53 loc) · 1.38 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
# project justfile
import? '.just/template-sync.just'
import? '.just/repo-toml.just'
import? '.just/pr-hook.just'
import? '.just/cue-verify.just'
import? '.just/copilot.just'
import? '.just/claude.just'
import? '.just/shellcheck.just'
import? '.just/compliance.just'
import? '.just/gh-process.just'
# just list (default)
list_recipes:
just --list
# run the code and see how it goes (default)
[group('Rust')]
try:
cargo run -- examples test_output
# run with backtrace enabled
[group('Rust')]
backtrace:
RUST_BACKTRACE=1 cargo run -- examples test_output
# what have you broken?
[group('Rust')]
check:
cargo fmt --check
cargo check
cargo clippy
cargo test --workspace
cargo audit
# add a crate dependancy
[group('Rust')]
newdep crate_name:
cargo add {{crate_name}}
cargo doc
# count posts per month
[group('Rust')]
count_posts output_dir='test_output':
#!/usr/bin/env bash
set -euo pipefail
if [ ! -d "{{output_dir}}" ]; then
echo "Directory {{output_dir}} does not exist"
exit 1
fi
echo "Post count by month in {{output_dir}}:"
echo "======================================"
find "{{output_dir}}" -maxdepth 1 -name "*.md" 2>/dev/null | \
sed 's|.*/||' | \
grep -E '^[0-9]{4}-[0-9]{2}-' | \
cut -d'-' -f1,2 | \
sort | \
uniq -c | \
awk '{printf "%s-%s: %2d posts\n", substr($2,1,4), substr($2,6,2), $1}' || \
echo "No markdown files found"