feat(depotfmt): Check & format Rust code with rustfmt

The rustfmt configuration of the depot is moved to `rustfmt.toml` (it
is recognised more reliably from this path than from the hidden
.rustfmt.toml).

Nested configuration is theoretically possible, but detection of
nested config files is flaky. Paths with nested config files need to
be disabled in the top-level check (I've excluded my user directory).

Change-Id: I385ce3ef529bda28fac03bfba86fc204c81b8a61
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5241
Tested-by: BuildkiteCI
Reviewed-by: grfn <grfn@gws.fyi>
This commit is contained in:
Vincent Ambo 2022-02-07 18:50:07 +03:00 committed by tazjin
parent 3d8ee62087
commit d254dbb848
3 changed files with 8 additions and 22 deletions

View file

@ -26,6 +26,13 @@ let
"third_party/nix/tests/*",
"third_party/nix/src/tests/*"
]
[formatter.rust]
command = "${pkgs.rustfmt}/bin/rustfmt"
includes = [ "*.rs" ]
excludes = [
"users/tazjin/*",
]
'';
# helper tool for formatting the depot interactively