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 22 imports = [
33 inputs . pre-commit-hooks . flakeModule # Adds perSystem.pre-commit options
44 ] ;
5- perSystem = { pkgs , lib , config , ... } :
5+ perSystem = { pkgs , ... } :
66 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 ;
108 in
119 {
1210 pre-commit . settings . hooks = {
1311 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
2512 {
2613 name = "rustfmt" ;
2714 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" ;
3516 files = "\\ .rs$" ;
36- pass_filenames = false ;
3717 } ;
3818 } ;
3919 } ;
Original file line number Diff line number Diff line change 99
1010 pre-commit = {
1111 settings = {
12- rawConfig . rust . cargoCratePaths = [ "runtimes/rust/lbr-prelude" ] ;
13-
1412 excludes = [
1513 "lambda-buffers-codegen/data/goldens/.*"
1614 "experimental/archive/.*"
You can’t perform that action at this time.
0 commit comments