Skip to content

Fix root_filter evaluates SimpleCov.root before initialization. - #437

Merged
colszowka merged 1 commit into
simplecov-ruby:masterfrom
tmtm:fix_root_filter
Jan 29, 2016
Merged

colszowka merged 1 commit into
simplecov-ruby:masterfrom
tmtm:fix_root_filter

Conversation

@tmtm

@tmtm tmtm commented Dec 7, 2015

Copy link
Copy Markdown
Contributor

If SimpleCov.root is set to other directory, but root_filter uses current directory.

require 'simplecov'
SimpleCov.root '/other/directory'
obj = Struct.new(:filename).new('/other/directory/test.rb')
p SimpleCov.filters.any?{ |filter| filter.matches? obj }
#=> returns true but it should be false.

Comment thread lib/simplecov/defaults.rb

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s unrelated to this PR, but this could be simplified into src.filename !~ root_filter.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right - if you like please send in a PR ❤️

@MikeMcQuaid

Copy link
Copy Markdown

CC @colszowka for thoughts as we're using a patched version of simplecov in Homebrew to workaround this issue. Thanks for your great work on this gem!

@UniqMartin

Copy link
Copy Markdown

Just to add a bit more context: This fixes a regression in 0.11.0 and above introduced by #396.

colszowka added a commit that referenced this pull request Jan 29, 2016
Fix root_filter evaluates SimpleCov.root before initialization.
@colszowka
colszowka merged commit f4098aa into simplecov-ruby:master Jan 29, 2016
@colszowka

Copy link
Copy Markdown
Collaborator

Makes sense, thanks!

colszowka added a commit that referenced this pull request Jan 29, 2016
@colszowka

Copy link
Copy Markdown
Collaborator

@MikeMcQuaid Thank you. We've been collecting a bunch of enhancements and now this bugfix, I'll try to get v0.11.2 out over the weekend - I want to go over the other open PRs and check if we can get those in too. Please complain if it's not out by Monday.

@MikeMcQuaid

Copy link
Copy Markdown

@colszowka Haha, thanks! The other one we (Homebrew) care about is #436; it'd be great if that (or the patch @bfontaine suggested) could make it in (although I know there's merge conflicts on the PR itself...)

@bfontaine

Copy link
Copy Markdown

Please complain if it's not out by Monday.

It’s Monday and it’s not out 😄

@colszowka

Copy link
Copy Markdown
Collaborator

Yip, sorry about that, didn't find the time to properly look into that other pending PR over the weekend since it apparently needs properly reading the source (there is a seemingly legit complaint in there regarding changed behavior)

Either I get that figured out or I'll ship an intermediate 0.11.2 first, then get that sorted and let 0.11.3 follow closely

@bfontaine

Copy link
Copy Markdown

@colszowka Don’t worry about the time it takes 😃

@colszowka

Copy link
Copy Markdown
Collaborator

So, 0.11.2 is out now, I'll try to get the merging thing figured out and let a 0.11.3 follow as soon as possible!

@bfontaine

Copy link
Copy Markdown

Thank you!

craiglittle pushed a commit to craiglittle/simplecov that referenced this pull request Feb 13, 2016
jsonn pushed a commit to jsonn/pkgsrc that referenced this pull request Feb 17, 2016
## Enhancements

## Bugfixes

0.11.2 2016-02-03 ([changes](simplecov-ruby/simplecov@v0.11.1...v0.11.2))
=================

## Enhancements

* Do not globally pollute Array and Hash with `merge_resultset` utility methods. See [#449](simplecov-ruby/simplecov#449) (thanks @amatsuda)
* Do not `mkdir_p` the `coverage_path` on every access of the method (See [#453](simplecov-ruby/simplecov#453) (thanks @paddor)
* Fixes a Ruby warning related to the `track_files` configuration. See [#447](simplecov-ruby/simplecov#447) (thanks @craiglittle)
* Add a group for background jobs to default Rails profile. See [#442](simplecov-ruby/simplecov#442) (thanks @stve)

## Bugfixes

* Fix root_filter evaluates SimpleCov.root before initialization. See [#437](simplecov-ruby/simplecov#437) (thanks @tmtm)
msk pushed a commit to msk/pkgsrc that referenced this pull request May 11, 2026
## Enhancements

## Bugfixes

0.11.2 2016-02-03 ([changes](simplecov-ruby/simplecov@v0.11.1...v0.11.2))
=================

## Enhancements

* Do not globally pollute Array and Hash with `merge_resultset` utility methods. See [#449](simplecov-ruby/simplecov#449) (thanks @amatsuda)
* Do not `mkdir_p` the `coverage_path` on every access of the method (See [#453](simplecov-ruby/simplecov#453) (thanks @paddor)
* Fixes a Ruby warning related to the `track_files` configuration. See [#447](simplecov-ruby/simplecov#447) (thanks @craiglittle)
* Add a group for background jobs to default Rails profile. See [#442](simplecov-ruby/simplecov#442) (thanks @stve)

## Bugfixes

* Fix root_filter evaluates SimpleCov.root before initialization. See [#437](simplecov-ruby/simplecov#437) (thanks @tmtm)
jperkin pushed a commit to TritonDataCenter/pkgsrc that referenced this pull request May 14, 2026
## Enhancements

## Bugfixes

0.11.2 2016-02-03 ([changes](simplecov-ruby/simplecov@v0.11.1...v0.11.2))
=================

## Enhancements

* Do not globally pollute Array and Hash with `merge_resultset` utility methods. See [#449](simplecov-ruby/simplecov#449) (thanks @amatsuda)
* Do not `mkdir_p` the `coverage_path` on every access of the method (See [#453](simplecov-ruby/simplecov#453) (thanks @paddor)
* Fixes a Ruby warning related to the `track_files` configuration. See [#447](simplecov-ruby/simplecov#447) (thanks @craiglittle)
* Add a group for background jobs to default Rails profile. See [#442](simplecov-ruby/simplecov#442) (thanks @stve)

## Bugfixes

* Fix root_filter evaluates SimpleCov.root before initialization. See [#437](simplecov-ruby/simplecov#437) (thanks @tmtm)
tsutsui pushed a commit to tsutsui/pkgsrc that referenced this pull request Oct 17, 2026
## Enhancements

## Bugfixes

0.11.2 2016-02-03 ([changes](simplecov-ruby/simplecov@v0.11.1...v0.11.2))
=================

## Enhancements

* Do not globally pollute Array and Hash with `merge_resultset` utility methods. See [#449](simplecov-ruby/simplecov#449) (thanks @amatsuda)
* Do not `mkdir_p` the `coverage_path` on every access of the method (See [#453](simplecov-ruby/simplecov#453) (thanks @paddor)
* Fixes a Ruby warning related to the `track_files` configuration. See [#447](simplecov-ruby/simplecov#447) (thanks @craiglittle)
* Add a group for background jobs to default Rails profile. See [#442](simplecov-ruby/simplecov#442) (thanks @stve)

## Bugfixes

* Fix root_filter evaluates SimpleCov.root before initialization. See [#437](simplecov-ruby/simplecov#437) (thanks @tmtm)
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.

5 participants