]> git.madduck.net Git - puppet/sudo.git/blob - Rakefile

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

split into files
[puppet/sudo.git] / Rakefile
1 require 'puppetlabs_spec_helper/rake_tasks'
2 require 'puppet-lint/tasks/puppet-lint'
3 require 'metadata-json-lint/rake_task'
4
5 if RUBY_VERSION >= '1.9'
6   require 'rubocop/rake_task'
7   RuboCop::RakeTask.new
8 end
9
10 PuppetLint.configuration.send('disable_80chars')
11 PuppetLint.configuration.relative = true
12 PuppetLint.configuration.ignore_paths = ['spec/**/*.pp', 'pkg/**/*.pp']
13
14 desc 'Validate manifests, templates, and ruby files'
15 task :validate do
16   Dir['manifests/**/*.pp'].each do |manifest|
17     sh "puppet parser validate --noop #{manifest}"
18   end
19   Dir['spec/**/*.rb', 'lib/**/*.rb'].each do |ruby_file|
20     sh "ruby -c #{ruby_file}" unless ruby_file =~ %r{spec/fixtures}
21   end
22   Dir['templates/**/*.erb'].each do |template|
23     sh "erb -P -x -T '-' #{template} | ruby -c"
24   end
25 end
26
27 desc 'Run lint, validate, and spec tests.'
28 task :test do
29   [:lint, :validate, :spec].each do |test|
30     Rake::Task[test].invoke
31   end
32 end