-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(just):just create the justfile
- Loading branch information
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/usr/bin/env just --justfile | ||
|
||
_CARGO_TARGET_DIR := env_var_or_default("CARGO_TARGET_DIR", "target") | ||
|
||
alias t := test | ||
alias l := lint | ||
alias c := check | ||
alias cov := coverage-report | ||
alias r := generate-readme | ||
alias s := setup | ||
|
||
default: check lint test | ||
|
||
setup: | ||
cargo install cargo-readme | ||
cargo install grcov | ||
cargo install committed | ||
cargo install cargo-deny | ||
cargo install cargo-audit --features=fix | ||
cargo install typos-cli | ||
# pip install codespell | ||
|
||
# Run all the tests | ||
test: | ||
cargo test | ||
|
||
|
||
# Check the program with all features enabled. | ||
check: | ||
cargo check | ||
cargo deny check | ||
cargo deny check licenses | ||
committed aurora..HEAD --no-merge-commit | ||
cargo audit | ||
typos | ||
# codespell --skip="target,git" --ignore-words="{{justfile_directory()}}/.codespellignore" | ||
|
||
@lint: | ||
cargo fmt --all -- --check --verbose | ||
cargo clippy --verbose --all-targets -- -D warnings | ||
|
||
# Run the tests, and generate a coverage report | ||
coverage: | ||
CARGO_INCREMENTAL=0 RUSTFLAGS="-Cinstrument-coverage" LLVM_PROFILE_FILE="{{_CARGO_TARGET_DIR}}/coverage/data/cargo-test-%p-%m.profraw" cargo test | ||
|
||
# Generate the coverage report | ||
coverage-report: coverage | ||
# Generate the report in html format using grcov | ||
grcov . --binary-path {{_CARGO_TARGET_DIR}}/debug/deps/ -s . -t html --branch --ignore-not-existing --ignore "../*" -o {{_CARGO_TARGET_DIR}}/coverage/report/ --llvm --ignore "/*" | ||
|
||
# Open the report in the browser | ||
xdg-open {{_CARGO_TARGET_DIR}}/coverage/report/index.html | ||
|
||
# Generate the readme file | ||
@generate-readme: | ||
cargo readme > README.md |