瀏覽代碼

chore: flakebox install

thesimplekid 6 月之前
父節點
當前提交
e2041d3928
共有 5 個文件被更改,包括 11 次插入7 次删除
  1. 1 1
      .config/flakebox/id
  2. 5 0
      .rustfmt.toml
  3. 3 4
      justfile
  4. 1 1
      misc/git-hooks/commit-msg
  5. 1 1
      misc/git-hooks/pre-commit

+ 1 - 1
.config/flakebox/id

@@ -1 +1 @@
-9501c5c269226a4ea1bca7043d0b0cbe88e451514e3d43c089f74880a8a482980b414fb9d8f933589b2a1598f79fbc5646cca86da35e49ec694f6070a7ff53e5
+e760eb996cb4d04ca4d503ecff1950521bf674ec1ddf8f8a7dc156ab5104fe11a67317fa5efcf97478fd58e0a62ac49800c14052ba95519f6e60e98e4f7a763b

+ 5 - 0
.rustfmt.toml

@@ -0,0 +1,5 @@
+group_imports = "StdExternalCrate"
+wrap_comments = true
+format_code_in_doc_comments = true
+imports_granularity = "Module"
+edition = "2021"

+ 3 - 4
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)

+ 1 - 1
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 <args> to fix your commit"
+   >&2 echo "Use git commit <args> to fix your commit"
   exit 1
 fi

+ 1 - 1
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