Sha256: 343bef41235e37f0e26be5277336808173f6b1c1eeda1cdff832b924832185c6

Contents?: true

Size: 844 Bytes

Versions: 2

Compression:

Stored size: 844 Bytes

Contents

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

options = {}
OptionParser.new do |opts|
  opts.banner = 'Usage: gherkin_language [files]'
  opts.on('-v', '--[no-]verbose', 'Run verbosely') do |verbose|
    options[:verbose] = verbose
  end
  opts.on('--enable [CHECKS]', 'Enabled checks. Separated by ","') do |checks|
    options[:enable] = checks.split(',')
  end
  opts.on('--disable [CHECKS]', 'Disabled checks. Separated by ","') do |checks|
    options[:disable] = checks.split(',')
  end
end.parse!

linter = GherkinLint::GherkinLint.new
linter.disable options[:disable] if options.key? :disable
linter.enable options[:enable] if options.key? :enable
linter.set_linter

files = ARGV
files = 'features/**/*.feature' if ARGV.empty?
files = Dir.glob(files)

files.each do |file|
  linter.analyze file
end

exit linter.report

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gherkin_lint-1.2.1 bin/gherkin_lint
gherkin_lint-1.1.0 bin/gherkin_lint