From 03bb9ef8c419273681199eb6e85c82fe0e4f3d51 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Wed, 1 Nov 2023 00:00:00 +0000 Subject: build(hooks) run tests in pre-push not pre-commit as the run time of the test suite has increased, the trade-off between convienence and the warm feeling of seeing a sea of green test passes for unrelated tests has changed --- git_hooks/pre-commit | 6 ------ git_hooks/pre-push | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 6 deletions(-) mode change 100755 => 100644 git_hooks/pre-commit create mode 100755 git_hooks/pre-push (limited to 'git_hooks') diff --git a/git_hooks/pre-commit b/git_hooks/pre-commit old mode 100755 new mode 100644 index 63b191d..5ec9f01 --- a/git_hooks/pre-commit +++ b/git_hooks/pre-commit @@ -15,10 +15,4 @@ then exit 1 fi -if ! cargo test -then - echo "There are some test issues." - exit 1 -fi - exit 0 \ No newline at end of file diff --git a/git_hooks/pre-push b/git_hooks/pre-push new file mode 100755 index 0000000..63b191d --- /dev/null +++ b/git_hooks/pre-push @@ -0,0 +1,24 @@ +#!/bin/sh + +set -eu + +if ! cargo fmt -- --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 + +exit 0 \ No newline at end of file -- cgit v1.2.3