diff options
Diffstat (limited to 'git-hooks')
| -rw-r--r-- | git-hooks/README | 14 | ||||
| -rwxr-xr-x | git-hooks/pre-commit | 10 |
2 files changed, 24 insertions, 0 deletions
diff --git a/git-hooks/README b/git-hooks/README new file mode 100644 index 0000000..f761258 --- /dev/null +++ b/git-hooks/README @@ -0,0 +1,14 @@ +This directory contains OPTIONAL git hooks, intended to make development +easier by catching common issues. + +You can either install them _en bloc_ by running + + git config core.hooksPath git-hooks + +in this repository, or install them individually by symlinking them from the +normal git hooks path. + +As always, don't run code you don't trust. Installing git hooks will cause +git to run them sooner or later. + +Enjoy! diff --git a/git-hooks/pre-commit b/git-hooks/pre-commit new file mode 100755 index 0000000..98f1c37 --- /dev/null +++ b/git-hooks/pre-commit @@ -0,0 +1,10 @@ +#!/bin/bash -e + +# Don't put anything here that routinely takes longer than a second or so to +# run. It gets old fast. That's why this uses `cargo check` and not `cargo +# test`, for example. + +# Make sure there are no screamers in the code. +cargo check +# Make sure the prepared statement data in .sqlx is up to date. +cargo sqlx prepare --check |
