forked from opentensor/subtensor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
54 lines (44 loc) · 1.58 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
#!/usr/bin/env just --justfile
export RUST_BACKTRACE := "full"
export SKIP_WASM_BUILD := "1"
export RUST_BIN_DIR := "target/x86_64-unknown-linux-gnu"
export TARGET := "x86_64-unknown-linux-gnu"
export RUSTV := "stable"
export RELEASE_NAME := "development"
fmt:
@echo "Running cargo fmt..."
cargo +{{RUSTV}} fmt --all
check:
@echo "Running cargo check..."
cargo +{{RUSTV}} check --workspace
test:
@echo "Running cargo test..."
cargo +{{RUSTV}} test --workspace
benchmarks:
@echo "Running cargo test with benchmarks..."
cargo +{{RUSTV}} test --workspace --features=runtime-benchmarks
clippy:
@echo "Running cargo clippy..."
cargo +{{RUSTV}} clippy --workspace --all-targets -- \
-D clippy::todo \
-D clippy::unimplemented
clippy-fix:
@echo "Running cargo clippy with automatic fixes on potentially dirty code..."
cargo +{{RUSTV}} clippy --fix --allow-dirty --allow-staged --workspace --all-targets -- \
-A clippy::todo \
-A clippy::unimplemented \
-A clippy::indexing_slicing
fix:
@echo "Running cargo fix..."
cargo +{{RUSTV}} fix --workspace
git diff --exit-code || (echo "There are local changes after running 'cargo fix --workspace' ❌" && exit 1)
lint:
@echo "Running cargo fmt..."
just fmt
@echo "Running cargo clippy with automatic fixes on potentially dirty code..."
just clippy-fix
@echo "Running cargo clippy..."
just clippy
production:
@echo "Running cargo build with metadata-hash generation..."
cargo +{{RUSTV}} build --profile production --features="metadata-hash"