Skip to content

Commit

Permalink
chore: add husky to enforce conventional commit message linter
Browse files Browse the repository at this point in the history
  • Loading branch information
azasypkin committed Mar 3, 2024
1 parent 2de1a13 commit 72ec7fb
Show file tree
Hide file tree
Showing 5 changed files with 1,548 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
target
out
*.iml
node_modules
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit ${1}
30 changes: 30 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/sh

set -eu

if ! cargo +nightly fmt --all -- --check
then
echo "There are some code style issues."
echo "Run `cargo fmt` first."
exit 1
fi

if ! cargo clippy --all-targets -- -D warnings
then
echo "There are some clippy issues."
exit 1
fi

if ! cargo test
then
echo "There are some test issues."
exit 1
fi

if ! cargo test --features thread_safe
then
echo "There are some test issues (with `thread_safe` feature)."
exit 1
fi

exit 0
Loading

0 comments on commit 72ec7fb

Please sign in to comment.