Sha256: 77a34ec1d21b0a68190b86122a77c81fa59094197c3ecfb73929974033b9e660

Contents?: true

Size: 836 Bytes

Versions: 16

Compression:

Stored size: 836 Bytes

Contents

module Reek
  module Report
    #
    # Formats the location of a warning as an empty string.
    #
    module BlankLocationFormatter
      module_function

      def format(_warning)
        ''
      end
    end

    #
    # Formats the location of a warning as an array of line numbers.
    #
    module DefaultLocationFormatter
      module_function

      def format(warning)
        "#{warning.lines.sort.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.
    #
    module SingleLineLocationFormatter
      module_function

      def format(warning)
        "#{warning.source}:#{warning.lines.sort.first}: "
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
reek-3.11 lib/reek/report/location_formatter.rb
reek-3.10.2 lib/reek/report/location_formatter.rb
reek-3.10.1 lib/reek/report/location_formatter.rb
reek-3.10.0 lib/reek/report/location_formatter.rb
reek-3.9.1 lib/reek/report/location_formatter.rb
reek-3.9.0 lib/reek/report/location_formatter.rb
reek-3.8.3 lib/reek/report/location_formatter.rb
reek-3.8.2 lib/reek/report/location_formatter.rb
reek-3.8.1 lib/reek/report/location_formatter.rb
reek-3.8.0 lib/reek/report/location_formatter.rb
reek-3.7.1 lib/reek/report/location_formatter.rb
reek-3.7.0 lib/reek/report/location_formatter.rb
reek-3.6.1 lib/reek/report/location_formatter.rb
reek-3.6.0 lib/reek/report/location_formatter.rb
reek-3.5.0 lib/reek/report/location_formatter.rb
reek-3.4.1 lib/reek/report/location_formatter.rb