Sha256: 773a563529f78178c53cd294e0d8867cfcba27497061317f83eccc9245b19686

Contents?: true

Size: 829 Bytes

Versions: 10

Compression:

Stored size: 829 Bytes

Contents

module Reek
  module Report
    #
    # Formats the location of a warning as an empty string.
    #
    # @api private
    module BlankLocationFormatter
      def self.format(_warning)
        ''
      end
    end

    #
    # Formats the location of a warning as an array of line numbers.
    #
    # @api private
    module DefaultLocationFormatter
      def self.format(warning)
        "#{warning.lines.inspect}:"
      end
    end

    #
    # Formats the location of a warning as a combination of source file name
    # and line number. In this format, it is not possible to show more than
    # one line number, so the first number is displayed.
    #
    # @api private
    module SingleLineLocationFormatter
      def self.format(warning)
        "#{warning.source}:#{warning.lines.first}: "
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
reek-3.3.1 lib/reek/report/location_formatter.rb
reek-3.3.0 lib/reek/report/location_formatter.rb
reek-3.2.1 lib/reek/report/location_formatter.rb
reek-3.2 lib/reek/report/location_formatter.rb
reek-3.1 lib/reek/report/location_formatter.rb
reek-3.0.4 lib/reek/report/location_formatter.rb
reek-3.0.3 lib/reek/report/location_formatter.rb
reek-3.0.2 lib/reek/report/location_formatter.rb
reek-3.0.1 lib/reek/report/location_formatter.rb
reek-3.0.0 lib/reek/report/location_formatter.rb