-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
65 lines (51 loc) · 1.53 KB
/
Copy pathjustfile
File metadata and controls
65 lines (51 loc) · 1.53 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
[private]
default:
@just --list
# Run a subset of checks as pre-commit hooks
pre-commit:
#!/usr/bin/env -S parallel --shebang --ungroup --jobs {{ num_cpus() }}
just prettier true
just format-toml true
just format-rust true
just lint-github-actions
just lint-markdown
just lint-rust
just lint-yaml
just test-rust
# Format JSON files
format-json fix="false": (prettier fix "{json,json5}")
# Format Markdown files
format-markdown fix="false": (prettier fix "md")
# Format Rust files
format-rust fix="false":
cargo fmt {{ if fix != "true" { "--check" } else { "" } }}
# Format TOML files
format-toml fix="false":
taplo fmt {{ if fix != "true" { "--diff" } else { "" } }}
# Format YAML files
format-yaml fix="false": (prettier fix "{yaml,yml}")
# Lint GitHub Actions workflows
lint-github-actions:
zizmor -p .
# Lint Markdown files
lint-markdown:
markdownlint **/*.md
# Lint Rust files
lint-rust:
cargo clippy --all-targets --all-features -- -D warnings
# Lint TOML files
lint-toml:
taplo check
# Lint YAML files
lint-yaml:
yamllint .
# Auto-format files with prettier
prettier fix="false" extension="*":
prettier {{ if fix == "true" { "--write" } else { "--list-different" } }} --ignore-unknown "**/*.{{ extension }}"
# Publish the crate to crates.io
publish:
cargo publish -p labelflair --all-features --token $CARGO_REGISTRY_TOKEN
cargo publish -p labelflair-cli --all-features --token $CARGO_REGISTRY_TOKEN
# Run the tests
test-rust:
cargo test --all-features --all-targets