-
Notifications
You must be signed in to change notification settings - Fork 157
/
Makefile
84 lines (66 loc) · 3.21 KB
/
Makefile
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
all: test defensive_test send_delay_test check_all
check_all: lint fmt doc unused_dep typos
defensive_test:
OPENRAFT_STORE_DEFENSIVE=on cargo test
send_delay_test:
OPENRAFT_NETWORK_SEND_DELAY=30 cargo test
test:
cargo test
cargo test --features bt
cargo test --features serde
cargo test --features single-term-leader
cargo test --manifest-path examples/raft-kv-memstore/Cargo.toml
cargo test --manifest-path examples/raft-kv-rocksdb/Cargo.toml
bench:
cargo bench --features bench
bench_cluster_of_1:
cargo test --manifest-path cluster_benchmark/Cargo.toml --test benchmark --release bench_cluster_of_1 -- --ignored --nocapture
bench_cluster_of_3:
cargo test --manifest-path cluster_benchmark/Cargo.toml --test benchmark --release bench_cluster_of_3 -- --ignored --nocapture
bench_cluster_of_5:
cargo test --manifest-path cluster_benchmark/Cargo.toml --test benchmark --release bench_cluster_of_5 -- --ignored --nocapture
fmt:
cargo fmt
fix:
cargo fix --allow-staged
doc:
make -C openraft/src/docs/faq
make -C openraft/src/docs/feature_flags
RUSTDOCFLAGS="-D warnings" cargo doc --document-private-items --all --no-deps
check_missing_doc:
# Warn about missing doc for public API
RUSTDOCFLAGS="-W missing_docs" cargo doc --all --no-deps
guide:
mdbook build
@echo "doc is built in:"
@echo "./guide/book/index.html"
lint:
cargo fmt
cargo fmt --manifest-path examples/memstore/Cargo.toml
cargo fmt --manifest-path examples/raft-kv-memstore-network-v2/Cargo.toml
cargo fmt --manifest-path examples/raft-kv-memstore-opendal-snapshot-data/Cargo.toml
cargo fmt --manifest-path examples/raft-kv-memstore-singlethreaded/Cargo.toml
cargo fmt --manifest-path examples/raft-kv-memstore/Cargo.toml
cargo fmt --manifest-path examples/raft-kv-rocksdb/Cargo.toml
cargo clippy --no-deps --all-targets -- -D warnings
cargo clippy --no-deps --manifest-path examples/memstore/Cargo.toml --all-targets -- -D warnings
cargo clippy --no-deps --manifest-path examples/raft-kv-memstore-network-v2/Cargo.toml --all-targets -- -D warnings
cargo clippy --no-deps --manifest-path examples/raft-kv-memstore-opendal-snapshot-data/Cargo.toml --all-targets -- -D warnings
cargo clippy --no-deps --manifest-path examples/raft-kv-memstore-singlethreaded/Cargo.toml --all-targets -- -D warnings
cargo clippy --no-deps --manifest-path examples/raft-kv-memstore/Cargo.toml --all-targets -- -D warnings
cargo clippy --no-deps --manifest-path examples/raft-kv-rocksdb/Cargo.toml --all-targets -- -D warnings
# Bug: clippy --all-targets reports false warning about unused dep in
# `[dev-dependencies]`:
# https://github.com/rust-lang/rust/issues/72686#issuecomment-635539688
# Thus we only check unused deps for lib
RUSTFLAGS=-Wunused-crate-dependencies cargo clippy --no-deps --lib -- -D warnings
unused_dep:
cargo machete
typos:
# cargo install typos-cli
typos --write-changes openraft/ tests/ stores/memstore/ stores/rocksstore stores/sledstore examples/raft-kv-memstore/ examples/raft-kv-rocksdb/
#typos --write-changes --exclude change-log/ --exclude change-log.md --exclude derived-from-async-raft.md
# typos
clean:
cargo clean
.PHONY: test fmt lint clean doc guide