Sha256: c64997c606c80e7d0f4f1d47f8cd6249f966cf6826c5e50e225efdb5d78afbf6

Contents?: true

Size: 790 Bytes

Versions: 4

Compression:

Stored size: 790 Bytes

Contents

#!/usr/bin/env ruby
require 'kafo_module_lint'
require 'optparse'

options = {modulepath: 'spec/fixtures/modules'}
OptionParser.new do |opts|
  opts.banner = "Usage: kafo-module-lint [options] [files..]"

  opts.on("-m", "--modulepath [MODULEPATH]", "Modulepath to load types from") do |mp|
    options[:modulepath] = mp
  end

  opts.on("-v", "--[no-]verbose", "Run verbosely") do |v|
    options[:verbose] = v
  end
end.parse!

files = ARGV.empty? ? Dir['manifests/**/*.pp'] : ARGV

result = true
KafoModuleLint::TypeLoader.new(options[:modulepath]).with_types do
  files.each do |manifest|
    puts "Checking #{manifest}" if options[:verbose]
    linter = KafoModuleLint::Linter.new(manifest)
    result = false unless linter.pass?
    linter.puts_errors
  end
end

exit(result ? 0 : 1)

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
kafo_module_lint-1.3.0 bin/kafo-module-lint
kafo_module_lint-1.1.0 bin/kafo-module-lint
kafo_module_lint-1.0.3 bin/kafo-module-lint
kafo_module_lint-1.0.2 bin/kafo-module-lint