lib/onceover/codequality/syntax.rb in onceover-codequality-0.5.0 vs lib/onceover/codequality/syntax.rb in onceover-codequality-0.5.1

- old
+ new

@@ -5,17 +5,21 @@ def self.puppet status = true # - # puppet-lint + # puppet-syntax # logger.info("Checking syntax using puppet-syntax rake task...") # puppet-syntax seems to assign $stdout/$stderr internally in ways that # prevent capturing output. As a nasty hack, run it as inline ruby and # capture the output from the process... - inline_ruby = "require 'puppet-syntax/tasks/puppet-syntax' ; Rake::Task['syntax'].invoke" + inline_ruby = <<-RUBY_CODE + require 'puppet-syntax/tasks/puppet-syntax' + PuppetSyntax.exclude_paths = ['vendor/**/*','spec/templates/*.erb'] + Rake::Task['syntax'].invoke + RUBY_CODE output, s = Open3.capture2e("ruby", "-e", inline_ruby) ok = s.exitstatus.zero? status &= ok if ok