Add Gemfile and puppet 4 checks

In anticipation of puppet 4, start trying to deal with puppet 4 things
that can be helpfully predicted by puppet lint plugins. This patch also
corrects lint errors caught by the puppet-lint-absolute_classname-check
and puppet-lint-empty_string-check gems.

We disable the disable_arrow_alignment check in the Rakefile.
Previously, the system version of puppet-lint that was being run by
'rake lint' was too old to catch this. When using 'bundle exec rake
lint' the gem is new enough to catch this. Whether we want to actually
fix these lint errors is a different discussion, so this patch disables
the check for now.

Change-Id: Ib44f2d6ac941e6fed118a5ff78bddd3d0f0a40b5
This commit is contained in:
Colleen Murphy 2015-07-11 18:36:12 -07:00
parent 885d35d54f
commit 140508f8a0
5 changed files with 39 additions and 5 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
Gemfile.lock
.bundled_gems/

32
Gemfile Normal file
View File

@ -0,0 +1,32 @@
source 'https://rubygems.org'
group :development, :test do
gem 'puppetlabs_spec_helper', :require => false
gem 'metadata-json-lint'
# This is nice and all, but let's not worry about it until we've actually
# got puppet 4.x sorted
# gem 'puppet-lint-param-docs'
gem 'puppet-lint-absolute_classname-check'
gem 'puppet-lint-absolute_template_path'
gem 'puppet-lint-trailing_newline-check'
# Puppet 4.x related lint checks
gem 'puppet-lint-unquoted_string-check'
# Hold off on the empty string check for now
gem 'puppet-lint-empty_string-check'
gem 'puppet-lint-leading_zero-check'
gem 'puppet-lint-variable_contains_upcase'
gem 'puppet-lint-numericvariable'
gem 'puppet-lint-spaceship_operator_without_tag-check'
gem 'puppet-lint-undef_in_function-check'
if puppetversion = ENV['PUPPET_GEM_VERSION']
gem 'puppet', puppetversion, :require => false
else
gem 'puppet', '~> 3.0', :require => false
end
end
# vim:ft=ruby

View File

@ -5,4 +5,5 @@ PuppetLint.configuration.fail_on_warnings = true
PuppetLint.configuration.send('disable_80chars') PuppetLint.configuration.send('disable_80chars')
PuppetLint.configuration.send('disable_autoloader_layout') PuppetLint.configuration.send('disable_autoloader_layout')
PuppetLint.configuration.send('disable_class_inherits_from_params_class') PuppetLint.configuration.send('disable_class_inherits_from_params_class')
PuppetLint.configuration.send('disable_class_parameter_defaults') PuppetLint.configuration.send('disable_class_parameter_defaults')
PuppetLint.configuration.send('disable_arrow_alignment')

View File

@ -20,7 +20,6 @@
# #
define asterisk::function::customdir( define asterisk::function::customdir(
) { ) {
include asterisk
File { File {
group => 'asterisk', group => 'asterisk',

View File

@ -20,10 +20,10 @@
# #
# == Class: asterisk # == Class: asterisk
class asterisk ( class asterisk (
$asterisk_conf_source = '', $asterisk_conf_source = undef,
$modules_conf_source = '', $modules_conf_source = undef,
) { ) {
include asterisk::server::command include ::asterisk::server::command
yumrepo { 'asteriskcurrent': yumrepo { 'asteriskcurrent':
baseurl => 'http://packages.asterisk.org/centos/$releasever/current/$basearch/', baseurl => 'http://packages.asterisk.org/centos/$releasever/current/$basearch/',