Sha256: 5ccffc6dd3b15ca1dceb6e0677fdb2cc09f08d5554f88b0e9b428c54dbbb5fd2

Contents?: true

Size: 700 Bytes

Versions: 9

Compression:

Stored size: 700 Bytes

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true
# Borrowed from https://gist.github.com/qortex/7e7c49f3731391a91ee898336183acef

# Temporary hack to get CodeClimate to work with SimpleCov 0.18 JSON format until issue is fixed
# upstream: https://github.com/codeclimate/test-reporter/issues/413

require "json"

filename = "coverage/.resultset.json"
contents = JSON.parse(File.read(filename))

def remove_lines_key(obj)
  case obj
  when Hash
    obj.transform_values do |val|
      val.is_a?(Hash) && val.key?("lines") ? val["lines"] : remove_lines_key(val)
    end
  else
    obj
  end
end

# overwrite
File.write(filename, JSON.generate(remove_lines_key(contents)))

puts Dir['coverage/.*.json']

Version data entries

9 entries across 9 versions & 4 rubygems

Version Path
u-case-4.5.2 bin/prepare_coverage
u-struct-1.0.0 bin/prepare_coverage
u-struct-0.12.0 bin/prepare_coverage
u-struct-0.11.0 bin/prepare_coverage
kind-5.10.0 bin/prepare_coverage
kind-5.9.0 bin/prepare_coverage
kind-5.8.1 bin/prepare_coverage
kind-5.8.0 bin/prepare_coverage
u-attributes-2.8.0 bin/prepare_coverage