Skip to content

Commit

Permalink
build: add cargo husky pre-commit hook (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshka authored Jan 15, 2024
1 parent 5d5a1cc commit 6b9417d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .cargo-husky/hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

# Exit on error. Append "|| true" if you expect an error.
set -o errexit
# Exit on error inside any functions or subshells.
set -o errtrace
# Do not allow use of undefined vars. Use ${VAR:-} to use an undefined VAR
set -o nounset
# Catch the error in case mysqldump fails (but gzip succeeds) in `mysqldump |gzip`
set -o pipefail
# Turn on traces, useful while debugging but commented out by default
# set -o xtrace

cargo nextest run
cargo test --doc
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ ratatui = "0.26.0-alpha.1"

[dev-dependencies]
trybuild = { version = "1.0.88", features = ["diff"] }
cargo-husky = { version = "1.5.0", features = ["user-hooks"] }



0 comments on commit 6b9417d

Please sign in to comment.