danger-xcov is the Danger plugin of xcov, a friendly visualizer for Xcode's code coverage files.
sudo gem install danger-xcov
Simply add xcov.report
to your Dangerfile
passing those xcov parameters
you need. Click here to
see the updated list of parameters allowed by xcov.
xcov.report(
scheme: 'EasyPeasy',
workspace: 'Example/EasyPeasy.xcworkspace',
exclude_targets: 'Demo.app',
minimum_coverage_percentage: 90,
minimum_file_coverage_percentage: 50,
)
The result is as cool as follows:
You can also process the output generated by xcov before posting the markdown report as follows:
# Generate report
report = xcov.produce_report(
scheme: 'EasyPeasy',
workspace: 'Example/EasyPeasy.xcworkspace',
exclude_targets: 'Demo.app',
minimum_coverage_percentage: 90,
minimum_file_coverage_percentage: 50,
)
# Do some custom filtering with the report here
# Post markdown report
xcov.output_report(report)
- Added
minimum_file_coverage_percentage
parameter to allow file based coverage threshold. - Filtering files which contain the keyword
View
Cell
Layout
For example any file named SomeViewController.swift
will be skipped from the minimum_file_coverage_percentage
check.
Add this to your gemfile instead of danger-xcov
, point it to this fork.
gem 'danger-xcov', :git => 'https://github.com/rachit-anurag/danger-xcov.git'
This project is licensed under the terms of the MIT license. See the LICENSE file.