Sha256: 1af140143bde9fe22498d51c59768c393405b80ca3a60e2bbc2b7ab3266cc631

Contents?: true

Size: 786 Bytes

Versions: 30

Compression:

Stored size: 786 Bytes

Contents

# frozen_string_literal: true

module Quality
  module Tools
    # Adds 'reek' tool support to quality gem
    module Reek
      def self.included(base)
        base.extend ClassMethods
      end

      private

      def quality_reek
        args = "--single-line #{ruby_files.join(' ')}"
        ratchet_quality_cmd('reek',
                            args: args,
                            emacs_format: true,
                            gives_error_code_on_violations: true) do |line|
          self.class.count_reek_violations(line)
        end
      end

      # See Reek.included
      module ClassMethods
        def count_reek_violations(line)
          if line =~ /^  .* (.*)$/
            1
          else
            0
          end
        end
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
quality-32.1.1 lib/quality/tools/reek.rb
quality-32.1.0 lib/quality/tools/reek.rb
quality-32.0.0 lib/quality/tools/reek.rb
quality-31.3.0 lib/quality/tools/reek.rb
quality-31.2.1 lib/quality/tools/reek.rb
quality-31.2.0 lib/quality/tools/reek.rb
quality-31.1.0 lib/quality/tools/reek.rb
quality-31.0.0 lib/quality/tools/reek.rb
quality-30.0.1 lib/quality/tools/reek.rb
quality-30.0.0 lib/quality/tools/reek.rb
quality-29.0.0 lib/quality/tools/reek.rb
quality-28.0.0 lib/quality/tools/reek.rb
quality-27.4.0 lib/quality/tools/reek.rb
quality-27.3.1 lib/quality/tools/reek.rb
quality-27.3.0 lib/quality/tools/reek.rb
quality-27.2.0 lib/quality/tools/reek.rb
quality-27.1.1 lib/quality/tools/reek.rb
quality-27.1.0 lib/quality/tools/reek.rb
quality-27.0.0 lib/quality/tools/reek.rb
quality-26.0.0 lib/quality/tools/reek.rb