Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add filter for hidden files and folders per default #721

Merged
merged 1 commit into from Jun 27, 2019
Merged

Add filter for hidden files and folders per default #721

merged 1 commit into from Jun 27, 2019

Conversation

schmijos
Copy link
Contributor

@schmijos schmijos commented Apr 8, 2019

It seems a bit weird, that hidden files and folders are included in the coverage measurement per default. They are hidden for a reason.

I now filter per default hidden folders and files in the root folder.

@colszowka do you have a strong opinion about that?

# frozen_string_literal: true

SimpleCov.profiles.define "hidden_filter" do
add_filter %r{^/\..*}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I could as well imagine to filter all hidden files and folders and not only the ones in the root folder. I didn't do it because it could be harder to debug.

Copy link
Collaborator

@PragTob PragTob left a comment

Choose a reason for hiding this comment

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

Hey!

Thanks for your contribution! I like this idea so I'm all for it. Would just love for an additional spec :)

IMG_20180818_152929


it "filters hidden files" do
expect(SimpleCov.filtered([a_file(".hidden_config.rb")]).count).to eq(0)
end
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you please add a test to verify that we're not filtering hidden sub folders? I like your argument for not filtering so I think we should spec it as expected behaviour :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're totally right! I added the test.

Copy link
Collaborator

@PragTob PragTob left a comment

Choose a reason for hiding this comment

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

👌

Brilliant, thank you!

@PragTob PragTob merged commit aca64da into simplecov-ruby:master Jun 27, 2019
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Nov 2, 2019
Update ruby-simplecov to 0.17.1.


0.17.1 (2019-09-16)
===================

Bugfix release for problems with ParallelTests.

## Bugfixes

* Avoid hanging with parallel_tests. See [#746](simplecov-ruby/simplecov#746) (thanks [@annaswims](https://github.com/annaswims))

0.17.0 (2019-07-02)
===================

Maintenance release with nice convenience features and important bugfixes.
Notably this **will be the last release to support ruby versions that have reached their end of life**. Moving forward official CRuby support will be 2.4+ and JRuby support will be 9.1+. Older versions might still work but no guarantees.

## Enhancements

* Per default filter hidden files and folders. See [#721](simplecov-ruby/simplecov#721) (thanks [Renuo AG](https://www.renuo.ch))
* Print the exit status explicitly when it's not a successful build so it's easier figure out SimpleCov failed the build in the output. See [#688](simplecov-ruby/simplecov#688) (thanks [@daemonsy](https://github.com/daemonsy))

## Bugfixes

* Avoid a premature failure exit code when setting `minimum_coverage` in combination with using [parallel_tests](https://github.com/grosser/parallel_tests). See [#706](simplecov-ruby/simplecov#706) (thanks [@f1sherman](https://github.com/f1sherman))
* Project roots with special characters no longer cause crashes. See [#717](simplecov-ruby/simplecov#717) (thanks [@deivid-rodriguez](https://github.com/deivid-rodriguez))
* Avoid continously overriding test results with manual `ResultMergere.store_results` usage. See [#674](simplecov-ruby/simplecov#674) (thanks [@tomeon](https://github.com/tomeon))
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.

None yet

2 participants