Sha256: 97be92d363a5f0586f787f2131e3f786cb38d372810204c2e7471fc1e2d35fdc

Contents?: true

Size: 1019 Bytes

Versions: 8

Compression:

Stored size: 1019 Bytes

Contents

# frozen_string_literal: true

require_relative 'code_climate/code_climate_formatter'
require_relative 'formatter/heading_formatter'
require_relative 'formatter/location_formatter'
require_relative 'formatter/progress_formatter'
require_relative 'formatter/simple_warning_formatter'
require_relative 'formatter/wiki_link_warning_formatter'

module Reek
  module Report
    #
    # Formatter handling the formatting of the report at large.
    # Formatting of the individual warnings is handled by the
    # passed-in warning formatter.
    #
    module Formatter
      module_function

      def format_list(warnings, formatter: SimpleWarningFormatter.new)
        warnings.map { |warning| "  #{formatter.format(warning)}" }.join("\n")
      end

      def header(examiner)
        count = examiner.smells_count
        result = Rainbow("#{examiner.description} -- ").cyan +
          Rainbow("#{count} warning").yellow
        result += Rainbow('s').yellow unless count == 1
        result
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
reek-4.8.2 lib/reek/report/formatter.rb
reek-4.8.1 lib/reek/report/formatter.rb
reek-4.8.0 lib/reek/report/formatter.rb
reek-4.7.3 lib/reek/report/formatter.rb
reek-4.7.2 lib/reek/report/formatter.rb
reek-4.7.1 lib/reek/report/formatter.rb
reek-4.7.0 lib/reek/report/formatter.rb
reek-4.6.2 lib/reek/report/formatter.rb