Skip to content

Commit

Permalink
Improve handling missing coverage info
Browse files Browse the repository at this point in the history
  • Loading branch information
yhkaplan authored Nov 9, 2021
1 parent d72d527 commit c441d41
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions lib/danger_plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,21 @@ def produce_report(*args)
report_json = nil
manager = Xcov::Manager.new(config)

if Xcov.config[:html_report] || Xcov.config[:markdown_report] || Xcov.config[:json_report]
# Parse .xccoverage and create local report
report_json = manager.run
else
# Parse .xccoverage
report_json = manager.parse_xccoverage
end
begin
if Xcov.config[:html_report] || Xcov.config[:markdown_report] || Xcov.config[:json_report]
# Parse .xccoverage and create local report
report_json = manager.run
else
# Parse .xccoverage
report_json = manager.parse_xccoverage
end

# Map and process report
process_report(Xcov::Report.map(report_json))

# Map and process report
process_report(Xcov::Report.map(report_json))
rescue => e
puts e
end
end

# Outputs a processed report with Danger
Expand Down

0 comments on commit c441d41

Please sign in to comment.