Skip to content

Commit f865001

Browse files
committed
Tidy SimpleCov comments now that 1.0+ is the baseline
Drop the historical < 1.0 / >= 1.0 version framing from the require-shim, #format override, and filtering-integration comments -- they described a migration that no longer applies once pre-1.0 support is gone.
1 parent 1d49737 commit f865001

2 files changed

Lines changed: 9 additions & 11 deletions

File tree

lib/undercover/simplecov_formatter.rb

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
require 'simplecov'
44
require 'json'
55

6-
# simplecov >= 1.0 ships its own simplecov_json_formatter.rb shim that can win
7-
# the require over the standalone gem depending on $LOAD_PATH order. Require the
8-
# standalone gem's classes by their subpaths (which simplecov does not ship) so
9-
# the SimpleCovJSONFormatter::* constants are always present.
6+
# SimpleCov ships its own simplecov_json_formatter.rb shim that can shadow the
7+
# standalone gem on $LOAD_PATH. Require the gem's classes by subpath (which the
8+
# shim does not define) so the SimpleCovJSONFormatter::* constants are present.
109
require 'simplecov_json_formatter/result_hash_formatter'
1110
require 'simplecov_json_formatter/result_exporter'
1211

@@ -120,9 +119,9 @@ class << self
120119
attr_accessor :output_filename
121120
end
122121

123-
# Own #format instead of inheriting SimpleCov::Formatter::JSONFormatter's:
124-
# simplecov >= 1.0 reimplemented it to bypass #format_result and always
125-
# write coverage.json, dropping undercover's meta and custom filename.
122+
# Own #format instead of inheriting SimpleCov::Formatter::JSONFormatter's,
123+
# which bypasses #format_result and always writes coverage.json, dropping
124+
# undercover's meta and custom filename.
126125
def format(result)
127126
result_hash = format_result(result)
128127
SimpleCovJSONFormatter::ResultExporter.new(result_hash).export

spec/simplecov_formatter_spec.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,9 @@ def matches?(_source_file)
244244
end
245245
end
246246

247-
# Integration coverage for the actual SimpleCov filtering path (skip), without
248-
# stubbing SimpleCov::Result#apply_filters!. This is the path that broke on
249-
# SimpleCov >= 1.0 when filtering moved out of SimpleCov.filtered into
250-
# SimpleCov::Result#apply_filters!, leaving ignored_files empty.
247+
# Integration coverage for the real SimpleCov filtering path (skip) via
248+
# SimpleCov::Result#apply_filters!, without stubbing -- this is what populates
249+
# ignored_files.
251250
RSpec.describe 'ignored_files through the real SimpleCov filtering path' do
252251
let(:kept_file) { File.expand_path('lib/undercover.rb', SimpleCov.root) }
253252
let(:string_filtered) { File.expand_path('lib/undercover/version.rb', SimpleCov.root) }

0 commit comments

Comments
 (0)