-
Notifications
You must be signed in to change notification settings - Fork 564
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
SimpleCov.profiles.define "hidden_filter" do | ||
add_filter %r{^/\..*} | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -173,6 +173,18 @@ def a_file(path) | |
it "filters vendor/bundle" do | ||
expect(SimpleCov.filtered([a_file("vendor/bundle/foo.rb")]).count).to eq(0) | ||
end | ||
|
||
it "filters hidden folders" do | ||
expect(SimpleCov.filtered([a_file(".semaphore-cache/lib.rb")]).count).to eq(0) | ||
end | ||
|
||
it "filters hidden files" do | ||
expect(SimpleCov.filtered([a_file(".hidden_config.rb")]).count).to eq(0) | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're totally right! I added the test. |
||
|
||
it "doesn't filter hidden files further down the path" do | ||
expect(SimpleCov.filtered([a_file("some_dir/.sneaky.rb")]).count).to eq(1) | ||
end | ||
end | ||
|
||
context "outside the project" do | ||
|
There was a problem hiding this comment.
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.