Add Puppet 4.x lint checks
authorGael Chamoulaud <gchamoul@redhat.com>
Tue, 13 Oct 2015 11:15:15 +0000 (13:15 +0200)
committerGael Chamoulaud <gchamoul@redhat.com>
Thu, 5 Nov 2015 14:44:18 +0000 (15:44 +0100)
- This change adds Puppet-lint bits for checking Puppet manifests.

Change-Id: I82869d8f9f6c64ac2a95429f453c3cb76c046974
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
.gitignore
Gemfile [new file with mode: 0644]
Rakefile [new file with mode: 0644]

index 3035c9e..6996d50 100644 (file)
@@ -45,6 +45,8 @@ nosetests.xml
 
 *~
 *.swp
+*.bundle
+Gemfile.lock
 
 doc/_build
 
diff --git a/Gemfile b/Gemfile
new file mode 100644 (file)
index 0000000..302ef41
--- /dev/null
+++ b/Gemfile
@@ -0,0 +1,24 @@
+source 'https://rubygems.org'
+
+group :development, :test do
+  gem 'puppetlabs_spec_helper', :require => false
+
+  gem 'puppet-lint', '~> 1.1'
+  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'
+  gem 'puppet-lint-leading_zero-check'
+  gem 'puppet-lint-variable_contains_upcase'
+  gem 'puppet-lint-numericvariable'
+end
+
+if puppetversion = ENV['PUPPET_GEM_VERSION']
+  gem 'puppet', puppetversion, :require => false
+else
+  gem 'puppet', :require => false
+end
+
+# vim:ft=ruby
diff --git a/Rakefile b/Rakefile
new file mode 100644 (file)
index 0000000..3d62bb6
--- /dev/null
+++ b/Rakefile
@@ -0,0 +1,5 @@
+require 'puppetlabs_spec_helper/rake_tasks'
+require 'puppet-lint/tasks/puppet-lint'
+
+PuppetLint.configuration.fail_on_warnings = true
+PuppetLint.configuration.send('disable_80chars')