Skip to content

Fix SimpleCov add_filter deprecation#69

Merged
mensfeld merged 2 commits into
masterfrom
fix-simplecov-add-filter-deprecation
Jul 13, 2026
Merged

Fix SimpleCov add_filter deprecation#69
mensfeld merged 2 commits into
masterfrom
fix-simplecov-add-filter-deprecation

Conversation

@mensfeld

@mensfeld mensfeld commented Jul 13, 2026

Copy link
Copy Markdown
Owner

What

  • SimpleCov add_filter -> skip: spec/spec_helper.rb now uses skip '/spec/' instead of the deprecated add_filter '/spec/' (SimpleCov 1.0.0 renamed it; add_filter is deprecated).
  • Commit Gemfile.lock: this repo previously ignored the lockfile. Gemfile.lock is now generated and checked in, and the active Gemfile.lock rule was removed from .gitignore. The lock resolves simplecov (1.0.0), so the skip API is guaranteed present when CI installs from the lock with bundler-cache: true.
  • CI tracks the latest Ruby 4.0 patch: .github/workflows/ci.yml no longer pins ruby-version: '4.0.5'. All three Ruby jobs (RSpec, RuboCop, Yard-Lint) now use ruby-version: '4.0', so ruby/setup-ruby resolves 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 no RUBY_VERSION gate in spec/spec_helper.rb — SimpleCov starts unconditionally with minimum_coverage line: 95, branch: 80.

Verification

Ran on a real Ruby 4.0.5 toolchain with the committed lockfile:

  • bundle install from the lock, then bundle exec rspec: 86 examples, 0 failures (exit 0, so the SimpleCov minimum-coverage thresholds pass and a coverage report is generated).
  • Gemfile.lock is tracked (git ls-files Gemfile.lock) and not ignored (git check-ignore reports nothing).
  • Workflow YAML parses; no 4.1 references anywhere in .github/workflows/.

mensfeld added 2 commits July 13, 2026 09:20
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
@mensfeld mensfeld merged commit 65f6770 into master Jul 13, 2026
5 checks passed
@mensfeld mensfeld deleted the fix-simplecov-add-filter-deprecation branch July 13, 2026 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant