From 61a51be95307b687897b74532d54c28ef113ba04 Mon Sep 17 00:00:00 2001
From: Awiteb
Date: Tue, 28 May 2024 22:25:11 +0300
Subject: [PATCH] chore: Add Justfile
Signed-off-by: Awiteb
---
Justfile | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
create mode 100644 Justfile
diff --git a/Justfile b/Justfile
new file mode 100644
index 0000000..8b2c4df
--- /dev/null
+++ b/Justfile
@@ -0,0 +1,30 @@
+# This justfile is for the contrbutors of this project, not for the end user.
+#
+# Requirements for this justfile:
+# - Linux distribution
+# - just (Of course)
+# - cargo (For the build and tests)
+
+set shell := ["/usr/bin/bash", "-c"]
+
+JUST_EXECUTABLE := "just -u -f " + justfile()
+header := "Available tasks:\n"
+# Get the MSRV from the Cargo.toml
+msrv := `cat Cargo.toml | grep "rust-version" | sed 's/.*"\(.*\)".*/\1/'`
+
+
+_default:
+ @{{JUST_EXECUTABLE}} --list-heading "{{header}}" --list
+
+# Run the CI
+@ci: && msrv
+ cargo build -q
+ cargo fmt -- --check
+ cargo clippy -- -D warnings
+
+# Check that the current MSRV is correct
+@msrv:
+ rustup toolchain install {{msrv}}
+ echo "Checking MSRV ({{msrv}})"
+ cargo +{{msrv}} check -q
+ echo "MSRV is correct"