Sha256: 68476aff97bc53c0a852927d7e313ca0c47767ff6141998b58776ca05feb1b73
Contents?: true
Size: 858 Bytes
Versions: 2
Compression:
Stored size: 858 Bytes
Contents
module Phare class CheckSuite attr_reader :status DEFAULT_CHECKS = { rubocop: Check::Rubocop, stylelint: Check::Stylelint, eslint: Check::Eslint } def initialize(options = {}) @options = options @directory = options[:directory] @directory << '/' unless @directory.end_with?('/') @options[:skip] ||= [] @options[:only] ||= [] end def checks checks = DEFAULT_CHECKS.keys if @options[:only].any? checks &= @options[:only] elsif @options[:skip] checks - @options[:skip] else checks end end def run @checks = checks.map do |check| check = DEFAULT_CHECKS[check] check.new(@directory, @options).tap(&:run).status end @status = @checks.find { |status| status > 0 } || 0 end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
phare-1.0.1 | lib/phare/check_suite.rb |
phare-1.0.0 | lib/phare/check_suite.rb |