projects
/
mirror
/
dsa-puppet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
we do not want that check
[mirror/dsa-puppet.git]
/
tools
/
git-hooks
/
pre-commit
diff --git
a/tools/git-hooks/pre-commit
b/tools/git-hooks/pre-commit
index
23e6e6a
..
8364fdc
100755
(executable)
--- a/
tools/git-hooks/pre-commit
+++ b/
tools/git-hooks/pre-commit
@@
-1,5
+1,11
@@
#!/bin/bash
#!/bin/bash
+if ! cmp -s ${PWD}/.git/hooks/pre-commit ${PWD}/tools/git-hooks/pre-commit ; then
+ rm -f ${PWD}/.git/hooks/pre-commit
+ ln -sf ../../tools/git-hooks/pre-commit ${PWD}/.git/hooks/pre-commit
+ exec ${PWD}/.git/hooks/pre-commit
+fi
+
if git rev-parse --verify HEAD &>/dev/null; then
against=HEAD
else
if git rev-parse --verify HEAD &>/dev/null; then
against=HEAD
else
@@
-15,7
+21,7
@@
check_puppet_manifest () {
git cat-file blob :0:${file} | sed 's/^import .*/#&/' >${pp}
trap "rm -f ${pp}" RETURN
git cat-file blob :0:${file} | sed 's/^import .*/#&/' >${pp}
trap "rm -f ${pp}" RETURN
- local output=$(puppet
apply --noop --ignoreimport
${pp} 2>&1)
+ local output=$(puppet
parser validate --storeconfigs true
${pp} 2>&1)
if [ $? -ne 0 ] || [ -n "${output}" ]; then
echo '** Syntax check failed:' >&2
echo "${output}" >&2
if [ $? -ne 0 ] || [ -n "${output}" ]; then
echo '** Syntax check failed:' >&2
echo "${output}" >&2
@@
-64,7
+70,7
@@
check_puppet_manifest () {
case "${file}" in
manifests/site.pp|modules/*/manifests/*)
if [[ -n "$(which puppet-lint)" ]]; then
case "${file}" in
manifests/site.pp|modules/*/manifests/*)
if [[ -n "$(which puppet-lint)" ]]; then
- puppet-lint --no-hard_tabs-check --no-80chars-check ${pp} >&2 | uniq
+ puppet-lint --no-hard_tabs-check --no-
2sp_soft_tabs-check --no-
80chars-check ${pp} >&2 | uniq
else
echo "Please install puppet-lint (gem install puppet-lint)" >&2
fi
else
echo "Please install puppet-lint (gem install puppet-lint)" >&2
fi