File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ # https://stackoverflow.com/questions/26886363/git-how-to-re-stage-the-staged-files-in-a-pre-commit-hook/39521255#39521255
3+ STASH_NAME=" pre-commit-$( date +%s) "
4+ git stash save --quiet --keep-index --include-untracked $STASH_NAME
5+
6+ ./tests.sh
7+
8+ RESULT=$?
9+ if [ $RESULT -ne 0 ]; then
10+ git stash save -q " original index"
11+ git stash apply -q --index stash@{1}
12+ git stash drop -q; git stash drop -q
13+ fi
14+ [ $RESULT -ne 0 ] && exit 1
15+
16+ git add -u
Original file line number Diff line number Diff line change 1+ cargo fmt --all --check
2+ cargo test --quiet --locked
3+ cargo clippy -- --deny warnings
4+ cargo clippy --tests -- --deny warnings
5+ find . -name ' *.nix' -exec nix fmt {} \+
6+ nix flake check
You can’t perform that action at this time.
0 commit comments