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

Exclude entire files from test coverage report #402

Closed
sashaperigo opened this issue Jul 28, 2015 · 2 comments
Closed

Exclude entire files from test coverage report #402

sashaperigo opened this issue Jul 28, 2015 · 2 comments

Comments

@sashaperigo
Copy link

My team uses SimpleCov with Code Climate and Travis CI. We have several entire files in our configurations folder that we'd like to skip from coverage reports. It'd be great if we could somehow configure this upfront in a .yml file, rather than using # :nocov: tags to surround each file!

@xaviershay
Copy link
Collaborator

I think you should be able to do this already using a filter.

SimpleCov.start do
  add_filter "path/to/your/file.rb"
end

Docs at https://github.com/colszowka/simplecov#defining-custom-filters (which suggest that this string is regex matched, so may need some anchors to make it specific enough)

Closing because I'm pretty sure that'll do it, but if not please do re-open!

@sashaperigo
Copy link
Author

@xaviershay you're right, that works! Thanks for your help!

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

No branches or pull requests

2 participants