From baaba41447e26c5d7f1c77dad3cb1eca7b510f17 Mon Sep 17 00:00:00 2001 From: Tomas Susanka Date: Fri, 12 Jul 2019 12:50:23 +0200 Subject: [PATCH] docs: move git hooks to core docs and update --- docs/git/hooks/README.md | 7 +++++++ {core/docs => docs}/git/hooks/pre-push | 9 ++++----- 2 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 docs/git/hooks/README.md rename {core/docs => docs}/git/hooks/pre-push (54%) diff --git a/docs/git/hooks/README.md b/docs/git/hooks/README.md new file mode 100644 index 000000000..5486f5d71 --- /dev/null +++ b/docs/git/hooks/README.md @@ -0,0 +1,7 @@ +# Git hooks + +## Install + +Copy these files to `.git/hooks/` to activate them. Run in root: + +`cp docs/git/hooks/* .git/hooks/` diff --git a/core/docs/git/hooks/pre-push b/docs/git/hooks/pre-push similarity index 54% rename from core/docs/git/hooks/pre-push rename to docs/git/hooks/pre-push index 7020c3e45..549aee573 100644 --- a/core/docs/git/hooks/pre-push +++ b/docs/git/hooks/pre-push @@ -2,20 +2,19 @@ # Runs a simple check before pushing. In particular, this checks # if templates were regenerated and style is correct. -# Put this file to `.git/hooks/`. echo "Running pre-push git hook." # Runs check for common simple errors before pushing -if ! make templates_check &> /dev/null +if ! pipenv run make templates_check &> /dev/null then - echo >&2 "Templates not updated, run 'make templates'. Not pushing." + echo >&2 "Templates not updated, run 'pipenv run make templates'. Not pushing." exit 1 fi -if ! make style_check &> /dev/null +if ! pipenv run make style_check &> /dev/null then - echo >&2 "Style invalid, run style make commands. Not pushing." + echo >&2 "Style invalid, run 'pipenv run make style'. Not pushing." exit 2 fi