From 03418819848f8bf1a7dafed90e9c17418145a305 Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Sat, 24 Feb 2024 15:21:01 +0100 Subject: [PATCH] fix(rust): add wrapper for running clippy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add wrapper for running clippy on each file separately, since ‹clippy-driver› accepts only one file at a time. Signed-off-by: Matej Focko --- .pre-commit-hooks.yaml | 2 +- rust/clippy-driver.sh | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100755 rust/clippy-driver.sh diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 2f99cc0..e07cf4e 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -21,7 +21,7 @@ - id: rust-clippy name: clippy description: Lint Rust sources with ‹clippy›. - entry: clippy-driver + entry: rust/clippy-driver.sh language: system types: - rust diff --git a/rust/clippy-driver.sh b/rust/clippy-driver.sh new file mode 100755 index 0000000..3045132 --- /dev/null +++ b/rust/clippy-driver.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +for src_file in "$@"; do + clippy-driver $src_file +done