File tree Expand file tree Collapse file tree 2 files changed +3
-25
lines changed Expand file tree Collapse file tree 2 files changed +3
-25
lines changed Original file line number Diff line number Diff line change 2
2
imports = [
3
3
inputs . pre-commit-hooks . flakeModule # Adds perSystem.pre-commit options
4
4
] ;
5
- perSystem = { pkgs , lib , config , ... } :
5
+ perSystem = { pkgs , ... } :
6
6
let
7
- inherit ( config . pre-commit . settings ) rawConfig ;
8
- inherit ( rawConfig . rust ) cargoCratePaths ;
9
- rust-bin = pkgs . rust-bin . stable . latest ;
7
+ rustfmt = pkgs . rust-bin . stable . latest . rustfmt ;
10
8
in
11
9
{
12
10
pre-commit . settings . hooks = {
13
11
rustfmt-monorepo =
14
- let
15
- wrapper = pkgs . symlinkJoin {
16
- name = "rustfmt-wrapped" ;
17
- paths = [ rust-bin . rustfmt ] ;
18
- nativeBuildInputs = [ pkgs . makeWrapper ] ;
19
- postBuild = ''
20
- wrapProgram $out/bin/cargo-fmt \
21
- --prefix PATH : ${ lib . makeBinPath [ rust-bin . cargo rust-bin . rustfmt ] }
22
- '' ;
23
- } ;
24
- in
25
12
{
26
13
name = "rustfmt" ;
27
14
description = "Format Rust code." ;
28
- entry =
29
- builtins . concatStringsSep " && "
30
- ( builtins . map
31
- ( path :
32
- "${ wrapper } /bin/cargo-fmt fmt --manifest-path '${ path } /Cargo.toml' -- --color always" )
33
-
34
- cargoCratePaths ) ;
15
+ entry = "${ rustfmt } /bin/rustfmt --color always" ;
35
16
files = "\\ .rs$" ;
36
- pass_filenames = false ;
37
17
} ;
38
18
} ;
39
19
} ;
Original file line number Diff line number Diff line change 9
9
10
10
pre-commit = {
11
11
settings = {
12
- rawConfig . rust . cargoCratePaths = [ "runtimes/rust/lbr-prelude" ] ;
13
-
14
12
excludes = [
15
13
"lambda-buffers-codegen/data/goldens/.*"
16
14
"experimental/archive/.*"
You can’t perform that action at this time.
0 commit comments