Skip to content

Commit

Permalink
Merge pull request #241 from scotje/maint_coveralls_exclude_gitignore
Browse files Browse the repository at this point in the history
(MAINT) Don't check coverage on gitignored files
  • Loading branch information
bmjen authored Aug 11, 2017
2 parents 65bdfba + 490aa3f commit 29937f8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,21 @@
]
SimpleCov.start do
track_files 'lib/**/*.rb'

add_filter '/spec'

# do not track vendored files
add_filter '/lib/puppet'
add_filter '/vendor'
add_filter '/.vendor'

# do not track gitignored files
# this adds about 4 seconds to the coverage check
# this could definitely be optimized
add_filter do |f|
# system returns true if exit status is 0, which with git-check-ignore means file is ignored
system("git check-ignore --quiet #{f.filename}")
end
end
end

Expand Down

0 comments on commit 29937f8

Please sign in to comment.