Add a pre-commit hook for rustfmt (#102)

* add a pre-commit hook for rustfmt

* make printing sccache stats optional

* fixup! add a pre-commit hook for rustfmt
This commit is contained in:
Pratyush Mishra
2020-03-04 16:05:57 -08:00
committed by GitHub
parent 50c0511ba3
commit 0b57cdd736
2 changed files with 45 additions and 0 deletions

9
scripts/install-hook.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/env bash
# This script will install the provided directory ../.hooks as the hook
# directory for the present repo. See there for hooks, including a pre-commit
# hook that runs rustfmt on files before a commit.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
HOOKS_DIR="${DIR}/../.hooks"
git config core.hooksPath "$HOOKS_DIR"