diff --git a/.config/flakebox/id b/.config/flakebox/id index 36aaf48..b848aed 100644 --- a/.config/flakebox/id +++ b/.config/flakebox/id @@ -1 +1 @@ -2fefc36adbe89c5c8953715f73d8c3d75062ecf9937b22e9b88afaa9cb261fc5bea72e092566df9803b7948b186f39abf7458504c35de64f5dec352a4e14d80d +7c5b3323e7050c438b828263bf7851a13504ea774e225e2fbf6277a0666e4e7949667131dac79c4fdb8ce25a8c4651336a9d9308cc28da74b830531224b9cd2b diff --git a/justfile b/justfile index 292e4fa..3af6d87 100644 --- a/justfile +++ b/justfile @@ -48,8 +48,7 @@ format: if [ ! -f Cargo.toml ]; then cd {{invocation_directory()}} fi - cargo fmt --all - nixfmt $(git ls-files | grep "\.nix$") + treefmt # run lints (git pre-commit hook) diff --git a/lib/mkDevShell.nix b/lib/mkDevShell.nix index cd7fab8..1a819fe 100644 --- a/lib/mkDevShell.nix +++ b/lib/mkDevShell.nix @@ -86,7 +86,7 @@ let treefmt ; # Nix - inherit (pkgs) nixfmt-rfc-style nil; + inherit (pkgs) nixfmt nil; # Rust tools inherit (pkgs) cargo-watch; # TODO: make conditional on `config.just.enable` diff --git a/lib/mkLintShell.nix b/lib/mkLintShell.nix index 6a52f04..5dc8781 100644 --- a/lib/mkLintShell.nix +++ b/lib/mkLintShell.nix @@ -67,7 +67,7 @@ let treefmt ; # Nix - inherit (pkgs) nixfmt-rfc-style; + inherit (pkgs) nixfmt; # TODO: make conditional on `config.just.enable` inherit (pkgs) just; }); diff --git a/lib/modules/cargo.nix b/lib/modules/cargo.nix index 2fcc686..29b56b0 100644 --- a/lib/modules/cargo.nix +++ b/lib/modules/cargo.nix @@ -6,9 +6,6 @@ cargo-lock.enable = lib.mkEnableOption "cargo lock check in pre-commit hook" // { default = true; }; - cargo-fmt.enable = lib.mkEnableOption "cargo fmt check in pre-commit hook" // { - default = true; - }; }; }; @@ -21,13 +18,5 @@ ''; }; }) - - (lib.mkIf config.cargo.pre-commit.cargo-fmt.enable { - git.pre-commit.hooks = { - cargo_fmt = '' - flakebox-in-each-cargo-workspace cargo fmt --all --check - ''; - }; - }) ]; } diff --git a/lib/modules/just.nix b/lib/modules/just.nix index 986253a..aa19831 100644 --- a/lib/modules/just.nix +++ b/lib/modules/just.nix @@ -192,8 +192,7 @@ in if [ ! -f Cargo.toml ]; then cd {{invocation_directory()}} fi - cargo fmt --all - nixfmt $(git ls-files | grep "\.nix$") + treefmt ''; }; }; diff --git a/misc/git-hooks/pre-commit b/misc/git-hooks/pre-commit index 7897815..82d1dc8 100755 --- a/misc/git-hooks/pre-commit +++ b/misc/git-hooks/pre-commit @@ -43,14 +43,6 @@ function check_nothing() { } export -f check_nothing -# NOTE: THIS FILE IS AUTO-GENERATED BY FLAKEBOX -function check_cargo_fmt() { - set -euo pipefail - - flakebox-in-each-cargo-workspace cargo fmt --all --check -} -export -f check_cargo_fmt - # NOTE: THIS FILE IS AUTO-GENERATED BY FLAKEBOX function check_cargo_lock() { set -euo pipefail @@ -160,7 +152,6 @@ export -f check_typos parallel \ --nonotice \ ::: \ - check_cargo_fmt \ check_cargo_lock \ check_semgrep \ check_shellcheck \