Skip to content

Commit

Permalink
chore: add justfile
Browse files Browse the repository at this point in the history
Thanks to @jcornaz
  • Loading branch information
ursjoss committed Apr 18, 2023
1 parent c97c9f4 commit ab64d7d
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
@_list:
just --list --unsorted

# Perform all verifications (compile, test, lint etc.)
verify: test lint

# Watch the source files and run `just verify` when sources change
watch:
cargo watch -- just verify

# Run the tests
test:
cargo hack test --feature-powerset

# Run the static code analysis
lint:
cargo fmt -- --check
cargo hack clippy --feature-powerset --all-targets

# Build the documentation
doc *args:
cargo doc --all-features --no-deps {{args}}

# Open the documentation page
doc-open: (doc "--open")

# Clean up compilation output
clean:
rm -rf target
rm -rf node_modules

# Install cargo dev-tools used by the `verify` recipe (requires rustup to be already installed)
install-dev-tools:
rustup install stable
rustup override set stable
cargo install cargo-hack cargo-watch

# Install a git hook to run tests before every commit
install-git-hooks:
echo '#!/usr/bin/env sh' > .git/hooks/pre-commit
echo 'just verify' >> .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit

0 comments on commit ab64d7d

Please sign in to comment.