Skip to content

Commit 6154395

Browse files
committed
feat: add justfile
1 parent 0432ba9 commit 6154395

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

justfile

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
alias b := build
2+
alias c := check
3+
alias f := fmt
4+
alias t := test
5+
alias p := pre-push
6+
7+
default:
8+
@just --list
9+
10+
# Build the project
11+
build:
12+
cargo build
13+
cargo build --no-default-features
14+
15+
# Check code: formatting, compilation, linting, and commit signature
16+
check:
17+
cargo +nightly fmt -- --check
18+
cargo check --all-features
19+
cargo clippy --all-features --all-targets -- -D warnings
20+
@[ "$(git log --pretty='format:%G?' -1 HEAD)" = "N" ] && \
21+
echo "\n⚠️ Unsigned commit: BDK requires that commits be signed." || \
22+
true
23+
24+
# Format all code
25+
fmt:
26+
cargo +nightly fmt
27+
28+
# Run all tests with all, default and no-default features
29+
test:
30+
cargo test --all-features
31+
cargo test
32+
cargo test --no-default-features
33+
34+
# Generate doc
35+
doc:
36+
cargo doc --open --all-features
37+
cargo doc --open
38+
cargo doc --open --no-default-features
39+
40+
# Generate code coverage
41+
code_cov:
42+
mkdir coverage
43+
touch coverage/lcov.info
44+
cargo +nightly llvm-cov -q --doctests --branch --all-features --lcov --output-path ./coverage/lcov.info
45+
@genhtml -o coverage-report.html --ignore-errors unmapped ./coverage/lcov.info
46+
open ./coverage-report.html/index.html
47+
rm -rf coverage
48+
49+
# Run pre-push suite: format, check, and test
50+
pre-push: fmt check test

0 commit comments

Comments
 (0)