Fix SimpleCov add_filter deprecation#69
Merged
Merged
Conversation
SimpleCov 1.0.0 (2026-07-12) renamed `add_filter` to `skip`. Update the coverage configuration in spec/spec_helper.rb to use `skip` so the warn-as-error setup no longer breaks once simplecov resolves to 1.0.0. `skip` exists only in simplecov >= 1.0.0. No Gemfile.lock is committed, so CI resolves simplecov fresh to 1.0.0. The Gemfile constraint is unpinned and there is no gemspec pin, so no dependency changes are required.
- Stop ignoring Gemfile.lock and commit it (simplecov resolves to 1.0.0) - Use ruby-version: '4.0' in CI so setup-ruby picks the newest 4.0 patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
add_filter->skip:spec/spec_helper.rbnow usesskip '/spec/'instead of the deprecatedadd_filter '/spec/'(SimpleCov 1.0.0 renamed it;add_filteris deprecated).Gemfile.lock: this repo previously ignored the lockfile.Gemfile.lockis now generated and checked in, and the activeGemfile.lockrule was removed from.gitignore. The lock resolves simplecov (1.0.0), so theskipAPI is guaranteed present when CI installs from the lock withbundler-cache: true..github/workflows/ci.ymlno longer pinsruby-version: '4.0.5'. All three Ruby jobs (RSpec, RuboCop, Yard-Lint) now useruby-version: '4.0', soruby/setup-rubyresolves the newest available 4.0 patch release.Coverage
The specs job runs a single Ruby (now
'4.0'), so coverage is produced on Ruby 4. There is noRUBY_VERSIONgate inspec/spec_helper.rb— SimpleCov starts unconditionally withminimum_coverage line: 95, branch: 80.Verification
Ran on a real Ruby 4.0.5 toolchain with the committed lockfile:
bundle installfrom the lock, thenbundle exec rspec: 86 examples, 0 failures (exit 0, so the SimpleCov minimum-coverage thresholds pass and a coverage report is generated).Gemfile.lockis tracked (git ls-files Gemfile.lock) and not ignored (git check-ignorereports nothing).4.1references anywhere in.github/workflows/.