diff --git a/.env b/.env new file mode 100644 index 0000000..755a48a --- /dev/null +++ b/.env @@ -0,0 +1,6 @@ +# Ubuntu packages +UBUNTU_PACKAGES= +# Windows packages +WINDOWS_PACKAGES= +# macOS packages +MACOS_PACKAGES= diff --git a/.justfile b/.justfile index 31d0fb1..323e1a7 100755 --- a/.justfile +++ b/.justfile @@ -1,8 +1,13 @@ #!/usr/bin/env -S just --working-directory . --justfile +# Load project-specific properties from the `.env` file + +set dotenv-load := true + # Since this is a first recipe it's being run by default. # Faster checks need to be executed first for better UX. For example - # codespell is very fast. cargo fmt does not need to download crates etc. + +# Perform all checks check: spelling formatting docs lints dependencies tests # Checks common spelling mistakes @@ -31,6 +36,16 @@ tests: docs: cargo doc --no-deps +# Installs packages required to build +[linux] +install-packages: + sudo apt-get install --assume-yes --no-install-recommends $UBUNTU_PACKAGES + +[macos] +[windows] +install-packages: + echo no-op + # Checks for commit messages check-commits REFS='main..': #!/usr/bin/env bash @@ -57,6 +72,7 @@ check-commits REFS='main..': # Fixes common issues. Files need to be git add'ed fix: #!/usr/bin/env bash + set -euo pipefail if ! git diff-files --quiet ; then echo "Working tree has changes. Please stage them: git add ." exit 1 @@ -64,6 +80,9 @@ fix: codespell --write-changes just --unstable --fmt + # try to fix rustc issues + cargo fix --allow-staged + # try to fix clippy issues cargo clippy --fix --allow-staged # fmt must be last as clippy's changes may break formatting