diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5774dd948..71d3bd72c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -87,4 +87,21 @@ repos: language: system files: ^maven-projects/spark/ pass_filenames: false - require_serial: true \ No newline at end of file + require_serial: true + + - id: cargo-fmt + name: Rust cargo fmt + entry: bash -c 'cd rust && cargo fmt --all' + language: system + files: ^rust/.*\.(rs|toml|lock)$ + pass_filenames: false + require_serial: true + + - id: cargo-clippy + name: Rust cargo clippy + entry: bash -c 'cd rust && cargo clippy --all-targets --all-features -- -D warnings' + language: system + files: ^rust/.*\.(rs|toml|lock)$ + pass_filenames: false + require_serial: true + stages: [manual]