From 10a36f2b9f4d5f58373f26ccc46775c9fa1e17ca Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Wed, 22 Dec 2021 14:11:22 +0200 Subject: [PATCH] Git config ensuring that 'nimble check' is executed before each commit --- .gitignore | 1 + scripts/add-project | 2 +- scripts/git-hooks/pre-commit | 4 ++++ workspace.gitconfig | 9 +++++++++ 4 files changed, 15 insertions(+), 1 deletion(-) create mode 100755 scripts/git-hooks/pre-commit create mode 100644 workspace.gitconfig diff --git a/.gitignore b/.gitignore index 0cabb6f..1b6bce7 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ nimble.develop # Track changes in the scripts folder !scripts/ +!scripts/* diff --git a/scripts/add-project b/scripts/add-project index d8a641f..fdc0a73 100755 --- a/scripts/add-project +++ b/scripts/add-project @@ -22,7 +22,7 @@ function _add_project { --with-dependencies \ "https://github.com/status-im/$PROJECT_NAME" - cp scripts/per-project.nimble.develop "$PROJECT_NAME/" + cp scripts/per-project.nimble.develop "$PROJECT_NAME/nimble.develop" } for p in $@ diff --git a/scripts/git-hooks/pre-commit b/scripts/git-hooks/pre-commit new file mode 100755 index 0000000..4610656 --- /dev/null +++ b/scripts/git-hooks/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +echo 'Creating a commit requires all Nimble checks to pass:' +nimble check diff --git a/workspace.gitconfig b/workspace.gitconfig new file mode 100644 index 0000000..b9203aa --- /dev/null +++ b/workspace.gitconfig @@ -0,0 +1,9 @@ +[core] + hooksPath = ../scripts/git-hooks + +[url "git@github.com:"] + insteadOf = https://github.com/ + +[url "git@github.com:"] + insteadOf = https://www.github.com/ +