Sha256: b07910d42c5f0998f41400a3de00836937ee650bb89da2f188e9037aeeafb694

Contents?: true

Size: 738 Bytes

Versions: 23

Compression:

Stored size: 738 Bytes

Contents

module Quality
  module Tools
    # Adds 'rubocop' tool support to quality gem
    module Rubocop
      private

      def quality_rubocop
        ratchet_quality_cmd('rubocop',
                            gives_error_code_on_violations: true,
                            args: "--format emacs #{ruby_files}") do |line|
          self.class.count_rubocop_violations(line)
        end
      end

      def self.included(base)
        base.extend ClassMethods
      end

      # See Rubocop.included
      module ClassMethods
        def count_rubocop_violations(line)
          if line =~ /^.* file[s|] inspected, (.*) offence[s|] detected$/
            0
          else
            1
          end
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
quality-14.0.0 lib/quality/tools/rubocop.rb
quality-13.0.0 lib/quality/tools/rubocop.rb
quality-12.0.0 lib/quality/tools/rubocop.rb
quality-11.0.0 lib/quality/tools/rubocop.rb
quality-10.0.0 lib/quality/tools/rubocop.rb
quality-9.0.0 lib/quality/tools/rubocop.rb
quality-8.1.1 lib/quality/tools/rubocop.rb
quality-8.1.0 lib/quality/tools/rubocop.rb
quality-8.0.0 lib/quality/tools/rubocop.rb
quality-7.0.0 lib/quality/tools/rubocop.rb
quality-6.0.0 lib/quality/tools/rubocop.rb
quality-5.0.1 lib/quality/tools/rubocop.rb
quality-5.0.0 lib/quality/tools/rubocop.rb
quality-4.0.2 lib/quality/tools/rubocop.rb
quality-4.0.1 lib/quality/tools/rubocop.rb
quality-4.0.0 lib/quality/tools/rubocop.rb
quality-3.1.0 lib/quality/tools/rubocop.rb
quality-3.0.0 lib/quality/tools/rubocop.rb
quality-2.1.1 lib/quality/tools/rubocop.rb
quality-2.1.0 lib/quality/tools/rubocop.rb