Skip to content

Commit

Permalink
TRY-31 add git hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
bircni committed Oct 21, 2023
1 parent fddb079 commit fc35a9b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .cargo-husky/hooks/commit-msg
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]

0 comments on commit fc35a9b

Please sign in to comment.