diff --git a/.cargo-husky/hooks/commit-msg b/.cargo-husky/hooks/commit-msg new file mode 100644 index 0000000..6985faf --- /dev/null +++ b/.cargo-husky/hooks/commit-msg @@ -0,0 +1,9 @@ +#!/bin/bash + +commit_msg_file=$1 +commit_msg=$(cat "$commit_msg_file") +pattern='^TRY-[0-9]+' +if [[ ! $commit_msg =~ $pattern ]]; then + echo "Error: Commit message must start with an issue number (e.g., TRY-42) followed by text." + exit 1 +fi diff --git a/Cargo.toml b/Cargo.toml index b21a68f..4de0504 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,5 +6,12 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +cargo-husky = "1.5.0" glium = "0.32.1" obj = "0.10.2" + +#"cargo test" +[dev-dependencies.cargo-husky] +version = "1.5.0" +default-features = false +features = [ "user-hooks" ]