From 0007b541cdbb7c42e6744bf8d32aff4a6e4bb2cf Mon Sep 17 00:00:00 2001 From: yihong Date: Mon, 15 Dec 2025 22:23:43 +0800 Subject: [PATCH] feat: add pre-commit file (#1155) Signed-off-by: yihong0618 --- .pre-commit-config.yaml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..9482f3b9 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,32 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +repos: + - repo: local + hooks: + - id: cargo-fmt + name: cargo fmt + entry: cargo fmt --all --check + language: system + types: [rust] + pass_filenames: false + + - id: cargo-clippy + name: cargo clippy + entry: cargo clippy --all-targets --all-features -- -D warnings + language: system + types: [rust] + pass_filenames: false + + - id: cargo-check + name: cargo check + entry: cargo check --all-targets + language: system + types: [rust] + pass_filenames: false + + - id: cargo-test + name: cargo test + entry: bash -c 'cargo test --workspace --exclude e2e_test && cargo test --all --doc' + language: system + types: [rust] + pass_filenames: false