Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .config/flakebox/id
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2fefc36adbe89c5c8953715f73d8c3d75062ecf9937b22e9b88afaa9cb261fc5bea72e092566df9803b7948b186f39abf7458504c35de64f5dec352a4e14d80d
7c5b3323e7050c438b828263bf7851a13504ea774e225e2fbf6277a0666e4e7949667131dac79c4fdb8ce25a8c4651336a9d9308cc28da74b830531224b9cd2b
3 changes: 1 addition & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/mkDevShell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion lib/mkLintShell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand Down
11 changes: 0 additions & 11 deletions lib/modules/cargo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
};
};

Expand All @@ -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
'';
};
})
];
}
3 changes: 1 addition & 2 deletions lib/modules/just.nix
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@ in
if [ ! -f Cargo.toml ]; then
cd {{invocation_directory()}}
fi
cargo fmt --all
nixfmt $(git ls-files | grep "\.nix$")
treefmt
'';
};
};
Expand Down
9 changes: 0 additions & 9 deletions misc/git-hooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -160,7 +152,6 @@ export -f check_typos
parallel \
--nonotice \
::: \
check_cargo_fmt \
check_cargo_lock \
check_semgrep \
check_shellcheck \
Expand Down