From b15d5467a4958b18ba50175e468e4b70535cb669 Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Fri, 17 May 2024 15:55:38 +0200 Subject: [PATCH] ref: Add pre-commit hook for rustfmt (#364) --- .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