summaryrefslogtreecommitdiff
path: root/justfile
diff options
context:
space:
mode:
authorStefan Kreutz <mail@skreutz.com>2026-04-30 10:10:46 +0200
committerStefan Kreutz <mail@skreutz.com>2026-04-30 10:10:46 +0200
commit46a3d2ba70decd1931e13c190bfa49217e57718d (patch)
tree49bc767c52d0cb4cf8443782cae1cc641ef59343 /justfile
parent47421e41def84ab92a52906f01266b1044fbfe29 (diff)
downloadtemp-postgres-46a3d2ba70decd1931e13c190bfa49217e57718d.tar.gz
Rewrite in async Rust
Diffstat (limited to 'justfile')
-rw-r--r--justfile54
1 files changed, 54 insertions, 0 deletions
diff --git a/justfile b/justfile
new file mode 100644
index 0000000..31d3a8b
--- /dev/null
+++ b/justfile
@@ -0,0 +1,54 @@
+alias fmt := format
+
+head := `git rev-parse HEAD`
+
+_default:
+ @just --list
+
+# Auto-format source code.
+format:
+ cargo fmt --all
+ env RUST_LOG=warn taplo format
+ find . -type f -iname justfile -print0 | xargs -0rn 1 just --fmt --unstable --justfile
+ find . -type f -name '*.nix' -print0 | xargs -0rn 1 nixfmt
+
+# Run all checks.
+check:
+ @# Check format
+ cargo fmt --all --check
+ env RUST_LOG=warn taplo format --check
+ find . -type f -iname justfile -print0 | xargs -0rn 1 just --fmt --unstable --check --justfile
+ @# nix fmt -- --ci # treefmt --ci is not read-only
+ find . -type f -name '*.nix' -print0 | xargs -0rn 1 nixfmt --check
+ @# Lint
+ env RUST_LOG=warn taplo lint
+ cargo clippy --workspace --all-targets --all-features -- --deny warnings
+ @# Build
+ cargo build --workspace --all-targets --all-features
+ env RUSTDOCFLAGS="-Dwarnings" cargo doc --all-features --no-deps --document-private-items
+ @# Test
+ cargo test --workspace --all-targets --all-features
+ @# Check dependencies for known security vulnerabilities, licenses, etc.
+ cargo audit
+ cargo deny --workspace --all-features check --show-stats bans licenses sources
+ @# Check Nix flake
+ nix flake check --print-build-logs --verbose
+ cd examples/nixos/ && nix flake check --print-build-logs --verbose --override-input temp-postgres ../..
+
+# Update Nix flake inputs, and Rust dependencies.
+update:
+ @# Update Nix flake inputs.
+ git diff --stat --exit-code
+ nix flake update
+ nix develop --command just check
+ git diff --stat --exit-code -- . ':(exclude)flake.lock'
+ git diff --no-patch --exit-code flake.lock || git commit --message 'Update Nix flake inputs' flake.lock
+ @# Update Rust dependencies.
+ git diff --stat --exit-code
+ nix develop --command cargo upgrade
+ nix develop --command cargo update
+ nix develop --command just check
+ git diff --stat --exit-code -- . ':(exclude)Cargo.toml' ':(exclude)Cargo.lock'
+ git diff --no-patch --exit-code Cargo.lock || git commit --message 'Update Rust dependencies' Cargo.toml Cargo.lock
+ @# Show commits.
+ git --no-pager log --stat {{ head }}..
Generated by cgit. See skreutz.com for my tech blog and contact information.