Sha256: 925f8ef6fddaaed92859dd1aad9835734304431674052cff5c1381cda03579af

Contents?: true

Size: 847 Bytes

Versions: 3

Compression:

Stored size: 847 Bytes

Contents

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

      #
      # Formats the location of a warning as an array of line numbers.
      #
      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.
      #
      module SingleLineLocationFormatter
        def self.format(warning)
          "#{warning.source}:#{warning.lines.first}: "
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
reek-2.2.1 lib/reek/cli/report/location_formatter.rb
reek-2.2.0 lib/reek/cli/report/location_formatter.rb
reek-2.1.0 lib/reek/cli/report/location_formatter.rb