Skip to content

Commit cd98892

Browse files
committed
Merge pull request #64 from garethhumphriesig/master
Allow puppet-lint control from config file
2 parents af9cc54 + cd8203d commit cd98892

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

commit_hooks/config.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
CHECK_PUPPET_LINT="enabled" # enabled, permissive or disabled (permissive runs but return code is ignored)
22
USE_PUPPET_FUTURE_PARSER="enabled" # enabled or disabled
3+
export PUPPET_LINT_OPTIONS="" # puppet-lint options to use if no rc file is present. Defaults to "--no-80chars-check"

commit_hooks/puppet_lint_checks.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ module_dir="$3"
1111
syntax_errors=0
1212
error_msg="$(mktemp /tmp/error_msg_puppet-lint.XXXXX)"
1313

14+
opts=${PUPPET_LINT_OPTIONS:-"--no-80chars-check"}
15+
1416
if [[ $module_dir ]]; then
1517
manifest_name="${manifest_path##*$module_dir}"
1618
error_msg_filter="sed -e s|$module_dir||"
@@ -30,7 +32,7 @@ if [[ -f $puppet_lint_rcfile ]]; then
3032
echo -e "$(tput setaf 6)Applying custom config from ${puppet_lint_rcfile}$(tput sgr0)"
3133
puppet_lint_cmd="$puppet_lint_cmd --config $puppet_lint_rcfile"
3234
else
33-
puppet_lint_cmd="$puppet_lint_cmd --no-80chars-check"
35+
puppet_lint_cmd="$puppet_lint_cmd $opts"
3436
fi
3537

3638
# If a file named .puppet-lint.rc exists in the directory where the file is located

0 commit comments

Comments
 (0)