From e122e946b86174e214ad0de24438f6c323b6b246 Mon Sep 17 00:00:00 2001 From: Khenziii Date: Sat, 20 Jan 2024 15:35:23 +0100 Subject: [PATCH] add pre-commit test using cargo-husky --- .cargo-husky/hooks/pre-commit | 6 ++++++ Cargo.lock | 9 +++++++++ Cargo.toml | 5 ++++- 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 .cargo-husky/hooks/pre-commit diff --git a/.cargo-husky/hooks/pre-commit b/.cargo-husky/hooks/pre-commit new file mode 100644 index 0000000..b006fa6 --- /dev/null +++ b/.cargo-husky/hooks/pre-commit @@ -0,0 +1,6 @@ +#!/bin/sh + +set -e + +echo '+cargo test' +cargo test diff --git a/Cargo.lock b/Cargo.lock index 3e5af0b..db83bc6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,15 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "cargo-husky" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b02b629252fe8ef6460461409564e2c21d0c8e77e0944f3d189ff06c4e932ad" + [[package]] name = "croissantdealer" version = "0.1.0" +dependencies = [ + "cargo-husky", +] diff --git a/Cargo.toml b/Cargo.toml index 02728e7..fe6f7af 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,4 +10,7 @@ license-file = "LICENSE" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html -[dependencies] +[dev-dependencies.cargo-husky] +version = "1.5.0" +default-features = false +features = ["user-hooks"]