Allow style url to be specified in a file inside the repository
This commit is contained in:
@@ -36,6 +36,12 @@ if [[ "x${HOME}" == "x" ]]; then
|
|||||||
export HOME
|
export HOME
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
styleguide_url='http://docs.puppetlabs.com/guides/style_guide.html'
|
||||||
|
git cat-file -e $newrev:.puppetstyle.url >/dev/null 2>&1
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
styleguide_url=$(git show $newrev:.puppetstyle.url)
|
||||||
|
fi
|
||||||
|
|
||||||
tmpdir=`mktemp -d`
|
tmpdir=`mktemp -d`
|
||||||
tmpfile="$tmpdir/candidate"
|
tmpfile="$tmpdir/candidate"
|
||||||
|
|
||||||
@@ -66,7 +72,7 @@ while read oldrev newrev refname; do
|
|||||||
rc=$?
|
rc=$?
|
||||||
if [[ $rc != 0 ]]; then
|
if [[ $rc != 0 ]]; then
|
||||||
if [[ $warned = 0 ]]; then
|
if [[ $warned = 0 ]]; then
|
||||||
echo -e "\e[0;33m" "Please follow the puppet module styleguide (http://docs.puppetlabs.com/guides/style_guide.html)." "\e[0m"
|
echo -e "\e[0;33m" "Please follow the puppet module styleguide (${styleguide_url})." "\e[0m"
|
||||||
echo -e "\e[0;33m" "The above ERROR/WARNING messages are informational only. The commit has not been blocked for this reason. In the future, these may cause your commit to be refused." "\e[0m"
|
echo -e "\e[0;33m" "The above ERROR/WARNING messages are informational only. The commit has not been blocked for this reason. In the future, these may cause your commit to be refused." "\e[0m"
|
||||||
warned=1
|
warned=1
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user