From 3203d69fd0a69bb4751bb08c250aacf5e6a0d308 Mon Sep 17 00:00:00 2001 From: iGxnon Date: Fri, 24 Nov 2023 16:38:24 +0800 Subject: [PATCH] chore: add hakari pre-commit hook Signed-off-by: iGxnon --- .config/hakari.toml | 2 +- .pre-commit-config.yaml | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.config/hakari.toml b/.config/hakari.toml index 87e86d3a6..181bc6456 100644 --- a/.config/hakari.toml +++ b/.config/hakari.toml @@ -27,7 +27,7 @@ unify-target-host = "unify-if-both" [traversal-excludes] third-party = [ - # Why regex and prost might be compile multipy times? + # Why regex and prost might be compile multiply times? { name = "regex" }, { name = "prost" }, ] diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3d30c010f..99ee4b22b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -65,9 +65,15 @@ repos: stages: [ commit-msg ] - id: cargo-sort name: Check Cargo.toml is sorted - description: 'Ensure Cargo.toml is sorted' + description: Ensure Cargo.toml is sorted entry: bash -c 'cargo sort --workspace' language: rust - types: [ file, toml ] files: Cargo\.toml pass_filenames: false + - id: cargo-hakari + name: Check if workspace-hack works correctly + description: Ensure workspace-hack works correctly + entry: bash -c 'cargo hakari generate --diff && cargo hakari manage-deps --dry-run && cargo hakari verify' + language: rust + files: Cargo\.(toml|lock) + pass_filenames: false