Sha256: b103b060c48731280fb7b4f31e3ec2703de1093a809464b0d15b1ca22bbe7033

Contents?: true

Size: 610 Bytes

Versions: 16

Compression:

Stored size: 610 Bytes

Contents

module LintTrap
  class Rubocop
    # Formats Rubocop output for LintTrap
    class Formatter < ::RuboCop::Formatter::BaseFormatter
      LINE_FORMAT = "%s:%d:%d:%d:%s:%s:%s\n"

      def file_finished(file, offenses)
        offenses.each do |offense|
          line = offense.line
          column = offense.real_column
          length = offense.location.length

          rule = offense.cop_name
          severity = offense.severity.name
          message = offense.message

          output.printf(LINE_FORMAT, file, line, column, length, rule, severity, message)
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
lint_trap-0.0.19 config/rubocop/formatter.rb
lint_trap-0.0.18 config/rubocop/formatter.rb
lint_trap-0.0.17 config/rubocop/formatter.rb
lint_trap-0.0.16 config/rubocop/formatter.rb
lint_trap-0.0.15 config/rubocop/formatter.rb
lint_trap-0.0.14 config/rubocop/formatter.rb
lint_trap-0.0.13 config/rubocop/formatter.rb
lint_trap-0.0.11 config/rubocop/formatter.rb
lint_trap-0.0.10 config/rubocop/formatter.rb
lint_trap-0.0.9 config/rubocop/formatter.rb
lint_trap-0.0.8 config/rubocop/formatter.rb
lint_trap-0.0.7 config/rubocop/formatter.rb
lint_trap-0.0.6 config/rubocop/formatter.rb
lint_trap-0.0.5 config/rubocop/formatter.rb
lint_trap-0.0.4 config/rubocop/formatter.rb
lint_trap-0.0.3 config/rubocop/formatter.rb