Sha256: 4be28c50a274f06a9a5fd4b45dc07da4bfcad77cacd332bbb3e0dc0766a8fb7e

Contents?: true

Size: 1018 Bytes

Versions: 9

Compression:

Stored size: 1018 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

9 entries across 9 versions & 1 rubygems

Version Path
reek-4.6.1 lib/reek/report/formatter.rb
reek-4.6.0 lib/reek/report/formatter.rb
reek-4.5.6 lib/reek/report/formatter.rb
reek-4.5.5 lib/reek/report/formatter.rb
reek-4.5.4 lib/reek/report/formatter.rb
reek-4.5.3 lib/reek/report/formatter.rb
reek-4.5.2 lib/reek/report/formatter.rb
reek-4.5.1 lib/reek/report/formatter.rb
reek-4.5.0 lib/reek/report/formatter.rb