From 94825922a040c6e8d9feb6da0643837bef816129 Mon Sep 17 00:00:00 2001 From: Sebastien Badia Date: Thu, 9 Oct 2014 16:50:53 +0200 Subject: [PATCH] Added metadata lint and puppet-syntax gems 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 | 2 ++ Rakefile | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/Gemfile b/Gemfile index d965fa90..b470b765 100644 --- 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' diff --git a/Rakefile b/Rakefile index 2e74217e..c022216c 100644 --- 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