Sha256: d24e67ecad3c7bfaf7e659a456d5e3e62de452f6d483e15369dd01a8868d36ff

Contents?: true

Size: 624 Bytes

Versions: 12

Compression:

Stored size: 624 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module Formatter
    # This formatter formats the report data in JSON format.
    class JSONFormatter < BaseFormatter
      # We need to expose the correctable status until https://github.com/rubocop-hq/rubocop/pull/7514 is merged
      def hash_for_offense(offense)
        {
          severity: offense.severity.name,
          message: offense.message,
          cop_name: offense.cop_name,
          corrected: offense.corrected?,
          correctable: offense.status != :unsupported,
          location: hash_for_location(offense),
        }
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
cookstyle-5.23.0 lib/rubocop/monkey_patches/json_formatter.rb
cookstyle-5.22.6 lib/rubocop/monkey_patches/json_formatter.rb
cookstyle-5.21.9 lib/rubocop/monkey_patches/json_formatter.rb
cookstyle-5.20.0 lib/rubocop/monkey_patches/json_formatter.rb
cookstyle-5.19.9 lib/rubocop/monkey_patches/json_formatter.rb
cookstyle-5.18.4 lib/rubocop/monkey_patches/json_formatter.rb
cookstyle-5.17.4 lib/rubocop/monkey_patches/json_formatter.rb
cookstyle-5.16.11 lib/rubocop/monkey_patches/json_formatter.rb
cookstyle-5.16.10 lib/rubocop/monkey_patches/json_formatter.rb
cookstyle-5.15.7 lib/rubocop/monkey_patches/json_formatter.rb
cookstyle-5.14.1 lib/rubocop/monkey_patches/json_formatter.rb
cookstyle-5.13.7 lib/rubocop/monkey_patches/json_formatter.rb