Rakefile 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. require 'puppetlabs_spec_helper/rake_tasks'
  2. require 'puppet/vendor/semantic/lib/semantic'
  3. require 'puppet-lint/tasks/puppet-lint'
  4. require 'puppet-syntax/tasks/puppet-syntax'
  5. # These gems aren't always present, for instance
  6. # on Travis with --without development
  7. begin
  8. require 'puppet_blacksmith/rake_tasks'
  9. rescue LoadError
  10. end
  11. Rake::Task[:lint].clear
  12. PuppetLint.configuration.relative = true
  13. PuppetLint.configuration.send("disable_80chars")
  14. PuppetLint.configuration.log_format = "%{path}:%{linenumber}:%{check}:%{KIND}:%{message}"
  15. PuppetLint.configuration.fail_on_warnings = true
  16. # Forsake support for Puppet 2.6.2 for the benefit of cleaner code.
  17. # http://puppet-lint.com/checks/class_parameter_defaults/
  18. PuppetLint.configuration.send('disable_class_parameter_defaults')
  19. # http://puppet-lint.com/checks/class_inherits_from_params_class/
  20. PuppetLint.configuration.send('disable_class_inherits_from_params_class')
  21. exclude_paths = [
  22. "bundle/**/*",
  23. "pkg/**/*",
  24. "vendor/**/*",
  25. "spec/**/*",
  26. ]
  27. PuppetLint.configuration.ignore_paths = exclude_paths
  28. PuppetSyntax.exclude_paths = exclude_paths
  29. desc "Run acceptance tests"
  30. RSpec::Core::RakeTask.new(:acceptance) do |t|
  31. t.pattern = 'spec/acceptance'
  32. end
  33. task :metadata do
  34. sh "metadata-json-lint metadata.json"
  35. end
  36. desc "Run syntax, lint, and spec tests."
  37. task :test => [
  38. :syntax,
  39. :lint,
  40. :spec,
  41. :metadata,
  42. ]