class Quality::Tools::Jscs

Adds 'bigfiles' tool support to quality gem

Public Instance Methods

jscs_args() click to toggle source
# File lib/quality/tools/jscs.rb, line 7
def jscs_args
  '-r unix ' + js_files.join(' ')
end
jscs_check_configured() click to toggle source
# File lib/quality/tools/jscs.rb, line 11
def jscs_check_configured
  return 0 if js_files.empty?

  puts 'No JSCS config found!  To generate one, run ' \
       'jscs --auto-configure representative_file.js'
  0
end
jscs_count_violations_on_line(line) click to toggle source
# File lib/quality/tools/jscs.rb, line 19
def jscs_count_violations_on_line(line)
  if line =~ /^.*:\d+:\d+: /
    1
  elsif line =~ /^No configuration found/
    jscs_check_configured
  else
    0
  end
end
quality_jscs() click to toggle source
# File lib/quality/tools/jscs.rb, line 29
def quality_jscs
  ratchet_quality_cmd('jscs',
                      args: jscs_args,
                      gives_error_code_on_violations: true) do |line|
    jscs_count_violations_on_line(line)
  end
end