Skip to content

Commit

Permalink
Merge pull request #208 from ghoneycutt/add_validation
Browse files Browse the repository at this point in the history
Add rake tasks to validate and lint files and check with Travis
  • Loading branch information
zaphod42 committed Dec 18, 2013
2 parents ef2cfd7 + 9226037 commit 7dc0fb6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .travis.yml
@@ -1,6 +1,6 @@
language: ruby
bundler_args: --without development
script: "bundle exec rake spec SPEC_OPTS='--color --format documentation'"
script: "bundle exec rake validate && bundle exec rake lint && bundle exec rake spec SPEC_OPTS='--color --format documentation'"
rvm:
- 1.8.7
- 1.9.3
Expand Down
2 changes: 2 additions & 0 deletions Gemfile
Expand Up @@ -39,4 +39,6 @@ else
gem 'puppet', :require => false
end

gem 'puppet-lint', '>= 0.3.2'

# vim:ft=ruby
16 changes: 16 additions & 0 deletions Rakefile
@@ -1,2 +1,18 @@
require 'rubygems'
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'
PuppetLint.configuration.send('disable_80chars')
PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"]

desc "Validate manifests, templates, and ruby files in lib."
task :validate do
Dir['manifests/**/*.pp'].each do |manifest|
sh "puppet parser validate --noop #{manifest}"
end
Dir['lib/**/*.rb'].each do |lib_file|
sh "ruby -c #{lib_file}"
end
Dir['templates/**/*.erb'].each do |template|
sh "erb -P -x -T '-' #{template} | ruby -c"
end
end

0 comments on commit 7dc0fb6

Please sign in to comment.