about summary refs log tree commit diff
path: root/tools
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-02-07T15·50+0300
committertazjin <tazjin@tvl.su>2022-02-08T12·06+0000
commitd254dbb848ecf093c0de54a9104915f47f782ad1 (patch)
tree5e9eefd071fa9cbe83e3ac0d8d1566783995429b /tools
parent3d8ee620875085ae7e8d7ef31f4f8e3738cfdca1 (diff)
feat(depotfmt): Check & format Rust code with rustfmt r/3792
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>
Diffstat (limited to 'tools')
-rw-r--r--tools/depotfmt.nix7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/depotfmt.nix b/tools/depotfmt.nix
index 21e71bf3b6..dbd3a31a0d 100644
--- a/tools/depotfmt.nix
+++ b/tools/depotfmt.nix
@@ -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