Sha256: a07ad97ac59e6e35337f988de510352319916e863a87be27b2674aba64bdfbeb
Contents?: true
Size: 1.61 KB
Versions: 6
Compression:
Stored size: 1.61 KB
Contents
#!/usr/bin/env ruby # frozen_string_literal: true require 'chutney' require 'chutney/formatter' require 'chutney/formatter/json_formatter' require 'chutney/formatter/pie_formatter' require 'chutney/formatter/rainbow_formatter' require 'optparse' formatters = Set.new OptionParser.new do |opts| opts.banner = 'Usage: chutney [files]' opts.on('-f', '--format [formatter]', 'One of JSONFormatter, PieFormatter or RainbowFormatter (default).') do |formatter| raise 'No Such Formatter' unless %w[JSONFormatter PieFormatter RainbowFormatter].include? formatter formatters << formatter end opts.on('-l', '--linters', 'List the linter status by this configuration and exit') do pastel = Pastel.new chutney_config = Chutney::ChutneyLint.new.configuration max_name_length = chutney_config.keys.map(&:length).max + 1 chutney_config.each do |linter, value| print pastel.cyan(linter.ljust(max_name_length)) if value['Enabled'] puts pastel.green('enabled') else puts pastel.red('disabled') end end exit end end.parse! formatters << 'RainbowFormatter' if formatters.empty? files = ARGV.map { |pattern| Dir.glob(pattern) }.flatten files = Dir.glob('features/**/*.feature') if ARGV.empty? linter = Chutney::ChutneyLint.new(*files) report = linter.analyse formatters.each do |formatter| f = Object.const_get("Chutney::#{formatter}").new f.results = report f.format end basic_formatter = Chutney::Formatter.new basic_formatter.results = report if basic_formatter.files_with_issues.empty? exit(true) else exit(false) end
Version data entries
6 entries across 6 versions & 1 rubygems
Version | Path |
---|---|
chutney-3.2.1 | exe/chutney |
chutney-3.2.0 | exe/chutney |
chutney-3.1.1 | exe/chutney |
chutney-3.1.0 | exe/chutney |
chutney-3.0.1 | exe/chutney |
chutney-3.0.0 | exe/chutney |