Sha256: 748797b7970774f5de8c22687f7230c1ee5063b0243740172f8e0b8a6eed8c68

Contents?: true

Size: 799 Bytes

Versions: 1

Compression:

Stored size: 799 Bytes

Contents

# encoding: utf-8

module Rubocop
  module Formatter
    # This formatter formats report data in clang style.
    # The precise location of the problem is shown together with the
    # relevant source code.
    class ClangStyleFormatter < SimpleTextFormatter
      def report_file(file, offences)
        offences.each do |o|
          output.printf("%s:%d:%d: %s: %s\n",
                        smart_path(file).color(:cyan), o.line, o.real_column,
                        colored_severity_code(o), message(o))

          source_line = o.location.source_line

          unless source_line.blank?
            output.puts(source_line)
            output.puts(' ' * o.location.column +
                        '^' * o.location.column_range.count)
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rubocop-0.14.0 lib/rubocop/formatter/clang_style_formatter.rb