]> review.fuel-infra Code Review - puppet-modules/puppet-ceilometer.git/commitdiff
Added metadata lint and puppet-syntax gems
authorSebastien Badia <sebastien.badia@enovance.com>
Thu, 9 Oct 2014 14:50:53 +0000 (16:50 +0200)
committerSebastien Badia <sebastien.badia@enovance.com>
Sun, 2 Nov 2014 17:08:36 +0000 (17:08 +0000)
metadata-json-lint is a little tool to check the validity of
Puppet metatdata.json files.

puppet-syntax tool check the validity of templates,manifests and hiera
files (the goal here is to replace manual checks in the gate by a
standard? check `rake syntax`).

Change-Id: I60b9cdfe27eeb8a8f5ad3a238dd847ed3096cb6b

Gemfile
Rakefile

diff --git a/Gemfile b/Gemfile
index d965fa900b55c05f0bff0745e222f5c2837c7d24..b470b7654e6ae85a158b2af25412540ac5093ecc 100644 (file)
--- a/Gemfile
+++ b/Gemfile
@@ -3,6 +3,8 @@ source 'https://rubygems.org'
 group :development, :test do
   gem 'puppetlabs_spec_helper', :require => false
   gem 'puppet-lint', '~> 0.3.2'
+  gem 'metadata-json-lint'
+  gem 'puppet-syntax'
   gem 'rake', '10.1.1'
   gem 'rspec', '< 2.99'
   gem 'json'
index 2e74217e1989cbbcd36c99076280269d66d2a0b3..c022216ce267972dfe80db7d57b1ec25fd624e8e 100644 (file)
--- a/Rakefile
+++ b/Rakefile
@@ -1,7 +1,17 @@
 require 'puppetlabs_spec_helper/rake_tasks'
 require 'puppet-lint/tasks/puppet-lint'
+require 'puppet-syntax/tasks/puppet-syntax'
 
 PuppetLint.configuration.fail_on_warnings = true
 PuppetLint.configuration.send('disable_80chars')
 PuppetLint.configuration.send('disable_class_parameter_defaults')
 PuppetLint.configuration.send('disable_only_variable_string')
+
+exclude_tests_paths = ['pkg/**/*','vendor/**/*']
+PuppetLint.configuration.ignore_paths = exclude_tests_paths
+PuppetSyntax.exclude_paths = exclude_tests_paths
+
+desc "Lint metadata.json file"
+task :metadata do
+  sh "metadata-json-lint metadata.json"
+end