-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathjustfile
64 lines (53 loc) · 1.46 KB
/
justfile
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
# Formats Rust files using rustfmt
_fmt-rustfmt *args:
#!/usr/bin/env sh
(
for f in `find src -name '*.rs'`; do
rustfmt $f {{ args }} &
done
wait
)
# Formats Leptos components using leptosfmt
_fmt-leptosfmt *args:
leptosfmt src/**/*.rs {{ args }}
# Formats justfile
_fmt-justfile:
just --unstable --fmt
# Formats Rust files including Leptos component syntax
fmt:
just _fmt-rustfmt
just _fmt-leptosfmt
just _fmt-justfile
_fmt-check-rustfmt:
just _fmt-rustfmt --check
_fmt-check-leptosfmt:
just _fmt-leptosfmt --check
_fmt-check-justfile:
just --unstable --fmt --check
# Checks formatting
fmt-check:
just _fmt-check-rustfmt
just _fmt-check-leptosfmt
just _fmt-check-justfile
# Checks examples formatting
fmt-check-examples:
#!/usr/bin/env sh
(cd examples/csr && just _fmt-check-rustfmt)
(cd examples/csr && just _fmt-check-leptosfmt)
(cd examples/ssr && just _fmt-check-rustfmt)
(cd examples/ssr && just _fmt-check-leptosfmt)
# Lints source with Clippy
lint:
cargo clippy --lib -- -D warnings
cargo clippy --lib --target wasm32-unknown-unknown -- -D warnings
# Lints examples with Clippy
lint-examples:
#!/usr/bin/env sh
(cd examples/csr && cargo clippy)
(cd examples/ssr && cargo clippy --features ssr)
(cd examples/ssr && cargo clippy --lib --features hydrate)
ci:
just fmt-check
just lint
just fmt-check-examples
just lint-examples