From 27e62180e019021e235b09c0412aaf527b183572 Mon Sep 17 00:00:00 2001 From: Pengfei Ni Date: Tue, 29 Nov 2016 16:52:32 +0800 Subject: [PATCH] Add pre-commit hooks for verifying pkg names --- hooks/pre-commit | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hooks/pre-commit b/hooks/pre-commit index 832f11f3d83..8c55d95b621 100755 --- a/hooks/pre-commit +++ b/hooks/pre-commit @@ -62,6 +62,18 @@ else fi echo "${reset}" +echo -ne "Checking for package aliases... " +if ! hack/verify-pkg-names.sh > /dev/null; then + echo "${red}ERROR!" + echo "Some package aliase break go conventions. To fix these errors, " + echo "do not use capitalizaed or underlined characters in pkg aliases. " + echo "Refer to https://blog.golang.org/package-names for more info." + exit_code=1 +else + echo "${green}OK" +fi +echo "${reset}" + echo -ne "Checking for files that need boilerplate... " files=($(git diff --cached --name-only --diff-filter ACM)) # We always make sure there is one file in the files list. Some tools check