From d3457038b49456d71524c2c786aa20d270ea5b71 Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Wed, 15 May 2024 15:18:42 +0200 Subject: [PATCH] ref: Add pre-commit hook for rustfmt --- .pre-commit-config.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5ef9f377..4d8d0720 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,5 +32,14 @@ repos: hooks: - id: isort name: isort (python) + - repo: local + hooks: + - id: cargo-fmt + name: format rust code + language: system + # keep in sync with Cargo.toml. There is no way to run cargo fmt for specific files + # https://github.com/rust-lang/rustfmt/issues/4485 + entry: rustfmt --edition 2021 + files: ^rust-arroyo/.*\.rs$ default_language_version: python: python3.8