Sha256: e737478d0c8b7681bd331bef749bae604a3e5b78e9b898af0d7976f57b850ecb

Contents?: true

Size: 793 Bytes

Versions: 1

Compression:

Stored size: 793 Bytes

Contents

module Quality
  module Tools
    # Adds 'bigfiles' tool support to quality gem
    module Jscs
      private

      def jscs_args
        '-r unix ' + js_files_arr.join(' ')
      end

      def jscs_check_configured
        return if js_files_arr.empty?

        puts 'No JSCS config found!  To generate one, run ' \
             'jscs --auto-configure ' + js_files_arr.join(' ')
        0
      end

      def quality_jscs
        ratchet_quality_cmd('jscs',
                            args: jscs_args,
                            gives_error_code_on_violations: true) do |line|
          return 1 if line =~ /^.*:\d+:\d+: /
          if line =~ /^No configuration found/
            jscs_check_configured
          else
            0
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
quality-19.1.1 lib/quality/tools/jscs.rb