From e2041d39288821559fe677817e7b72e987b15f9d Mon Sep 17 00:00:00 2001 From: thesimplekid Date: Thu, 29 Aug 2024 11:40:56 +0100 Subject: [PATCH] chore: flakebox install --- .config/flakebox/id | 2 +- .rustfmt.toml | 5 +++++ justfile | 7 +++---- misc/git-hooks/commit-msg | 2 +- misc/git-hooks/pre-commit | 2 +- 5 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 .rustfmt.toml diff --git a/.config/flakebox/id b/.config/flakebox/id index c805c8fe..34009563 100644 --- a/.config/flakebox/id +++ b/.config/flakebox/id @@ -1 +1 @@ -9501c5c269226a4ea1bca7043d0b0cbe88e451514e3d43c089f74880a8a482980b414fb9d8f933589b2a1598f79fbc5646cca86da35e49ec694f6070a7ff53e5 +e760eb996cb4d04ca4d503ecff1950521bf674ec1ddf8f8a7dc156ab5104fe11a67317fa5efcf97478fd58e0a62ac49800c14052ba95519f6e60e98e4f7a763b diff --git a/.rustfmt.toml b/.rustfmt.toml new file mode 100644 index 00000000..35cd2821 --- /dev/null +++ b/.rustfmt.toml @@ -0,0 +1,5 @@ +group_imports = "StdExternalCrate" +wrap_comments = true +format_code_in_doc_comments = true +imports_granularity = "Module" +edition = "2021" diff --git a/justfile b/justfile index e28c3260..f3b1eb36 100644 --- a/justfile +++ b/justfile @@ -1,5 +1,4 @@ # THIS FILE IS AUTOGENERATED FROM FLAKEBOX CONFIGURATION -import "./misc/justfile.custom.just" alias b := build alias c := check @@ -10,6 +9,7 @@ alias t := test default: @just --list + # run `cargo build` on everything build *ARGS="--workspace --all-targets": #!/usr/bin/env bash @@ -31,13 +31,12 @@ check *ARGS="--workspace --all-targets": # run all checks recommended before opening a PR -final-check: lint clippy check-wasm +final-check: lint clippy #!/usr/bin/env bash set -euo pipefail if [ ! -f Cargo.toml ]; then cd {{invocation_directory()}} fi - cargo test --doc just test @@ -49,7 +48,7 @@ format: cd {{invocation_directory()}} fi cargo fmt --all - nixpkgs-fmt $(echo **.nix) + nixpkgs-fmt $(git ls-files | grep "\.nix$") # run lints (git pre-commit hook) diff --git a/misc/git-hooks/commit-msg b/misc/git-hooks/commit-msg index b4fe09a0..922aa4c1 100755 --- a/misc/git-hooks/commit-msg +++ b/misc/git-hooks/commit-msg @@ -18,6 +18,6 @@ MESSAGE="$( MESSAGE="${MESSAGE#fixup! }" if ! convco check --from-stdin <<<"$MESSAGE" ; then >&2 echo "Please follow conventional commits(https://www.conventionalcommits.org)" - >&2 echo "Use git recommit to fix your commit" + >&2 echo "Use git commit to fix your commit" exit 1 fi diff --git a/misc/git-hooks/pre-commit b/misc/git-hooks/pre-commit index 7959e970..8ef0f144 100755 --- a/misc/git-hooks/pre-commit +++ b/misc/git-hooks/pre-commit @@ -43,7 +43,7 @@ function check_cargo_lock() { set -euo pipefail # https://users.rust-lang.org/t/check-if-the-cargo-lock-is-up-to-date-without-building-anything/91048/5 - flakebox-in-each-cargo-workspace cargo update --workspace --locked + flakebox-in-each-cargo-workspace cargo update --workspace --locked |& while read -r note ; do echo "$note (cargo)"; done } export -f check_cargo_lock