From cc87a06f83c6cd8186e482c6c703a1cfdcf65ff6 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 29 Jul 2016 15:04:47 +0200 Subject: [PATCH] only include rubocop when we need it --- moduleroot/Rakefile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/moduleroot/Rakefile b/moduleroot/Rakefile index 979cb8ae..40bb83f9 100644 --- a/moduleroot/Rakefile +++ b/moduleroot/Rakefile @@ -1,12 +1,15 @@ require 'puppetlabs_spec_helper/rake_tasks' require 'puppet_blacksmith/rake_tasks' require 'voxpupuli/release/rake_tasks' -require 'rubocop/rake_task' require 'puppet-strings/rake_tasks' -RuboCop::RakeTask.new(:rubocop) do |task| - # These make the rubocop experience maybe slightly less terrible - task.options = ['-D', '-S', '-E'] +if RUBY_VERSION >= '2.0.0' + require 'rubocop/rake_task' + + RuboCop::RakeTask.new(:rubocop) do |task| + # These make the rubocop experience maybe slightly less terrible + task.options = ['-D', '-S', '-E'] + end end PuppetLint.configuration.log_format = '%{path}:%{linenumber}:%{check}:%{KIND}:%{message}'