From cd7cf0434f173b3ac135f2678ab38d1bc82f19c4 Mon Sep 17 00:00:00 2001 From: msi Date: Sun, 16 Nov 2025 12:28:25 -0300 Subject: Add lib template --- lib/template/Justfile | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 lib/template/Justfile (limited to 'lib/template/Justfile') diff --git a/lib/template/Justfile b/lib/template/Justfile new file mode 100644 index 0000000..d751545 --- /dev/null +++ b/lib/template/Justfile @@ -0,0 +1,38 @@ +#!/usr/bin/env -S just --justfile + +_default: + @just --list -u + +# ==================== ALIASES ==================== +alias r := ci + +# ==================== SETUP & INITIALIZATION ==================== + +# Install git pre-commit hook to format files +install-hook: + echo -e "#!/bin/sh\njust fmt" > .git/hooks/pre-commit + chmod +x .git/hooks/pre-commit + +# ==================== CORE DEVELOPMENT ==================== + +watch +args='test --all': + cargo watch --clear --exec '{{args}}' + +ci: + cargo test --all + cargo clippy --all + cargo fmt --all -- --check + +# publish current master branch +publish: + #!/usr/bin/env bash + set -euxo pipefail + rm -rf tmp/release + git clone git@github.com + VERSION=`sed -En 's/version[[:space:]]*=[[:space:]]*"([^"]+)"/\1/p' Cargo.toml | head -1` + cd tmp/release + git tag -a $VERSION -m "Release $VERSION" + git push origin $VERSION + cargo publish + cd ../.. + rm -rf tmp/release -- cgit v1.2.3