Skip to content

Commit

Permalink
Merge pull request #199 from skyfoxa/master
Browse files Browse the repository at this point in the history
Support for include_zero_targets option
  • Loading branch information
joshdholtz authored Mar 1, 2022
2 parents f95cb5c + ea83513 commit 8549ceb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/xcov/model/report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ def self.map(dictionary)
# Create target objects
targets = targets.map { |target| Target.map(target) }.sort { |lhs, rhs| lhs.name <=> rhs.name }

if !Xcov.config[:include_zero_targets]
targets = targets.select { |target| target.coverage > 0 }
end

Report.new(targets)
end

Expand Down
7 changes: 7 additions & 0 deletions lib/xcov/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,13 @@ def self.available_options
is_string: false,
default_value: false
),
FastlaneCore::ConfigItem.new(
key: :include_zero_targets,
env_name: "XCOV_INCLUDE_ZERO_TARGETS",
description: "Final report will include target even if the coverage is 0%",
is_string: false,
default_value: true
),
FastlaneCore::ConfigItem.new(
key: :exclude_targets,
optional: true,
Expand Down

0 comments on commit 8549ceb

Please sign in to comment.