From 89172201952f978549b0e2dce3f90236eb40dc70 Mon Sep 17 00:00:00 2001 From: Yanis Guenane Date: Tue, 30 Sep 2014 23:21:38 -0400 Subject: [PATCH] Rakefile : Verify Puppetfile syntax A :validate_puppetfile task has been added to Rakefile so it is possible to detect Puppetfile syntax error before merging future pull-request --- Gemfile | 1 + Rakefile | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index e38bd1f1..764c8d16 100644 --- a/Gemfile +++ b/Gemfile @@ -9,6 +9,7 @@ group :development, :test do gem 'rspec' gem 'json' gem 'webmock' + gem 'r10k' end if puppetversion = ENV['PUPPET_GEM_VERSION'] diff --git a/Rakefile b/Rakefile index dbbddfec..4afd997d 100644 --- a/Rakefile +++ b/Rakefile @@ -28,14 +28,20 @@ task(:default).clear task :default => :test desc 'Run syntax, lint and spec tests' -task :test => [:syntax,:lint,:spec] +task :test => [:syntax,:lint,:validate_puppetfile,:spec] desc 'Run syntax, lint and spec tests (without fixture purge = train/airplane)' -task :test_keep => [:syntax,:lint,:spec_prep,:spec_standalone] +task :test_keep => [:syntax,:lint,:validate_puppetfile,:spec_prep,:spec_standalone] if ENV['COV'] desc 'Run syntax, lint, spec tests and coverage' - task :cov => [:syntax,:lint,:spec_prep,:spec_standalone] + task :cov => [:syntax,:lint,:validate_puppetfile,:spec_prep,:spec_standalone] +end + +desc "Validate the Puppetfile syntax" +task :validate_puppetfile do + $stderr.puts "---> syntax:puppetfile" + sh "r10k puppetfile check" end namespace :module do