lib/phare/check/jscs.rb in phare-0.6 vs lib/phare/check/jscs.rb in phare-0.7

- old
+ new

@@ -1,6 +1,9 @@ # encoding: utf-8 + +require 'json' + module Phare class Check class JSCS < Check attr_reader :config, :path @@ -13,16 +16,24 @@ super end def command if @tree.changed? - "jscs #{@tree.changes.join(' ')}" + "jscs #{files_to_check.join(' ')}" else "jscs #{@path}" end end protected + + def excluded_list + configuration_file['excludeFiles'] + end + + def configuration_file + @configuration_file ||= File.exist?('.jscs.json') ? JSON.parse(File.read('.jscs.json')) : {} + end def binary_exists? !Phare.system_output('which jscs').empty? end