Danger-slather
A Danger plugin that show code coverage of a Xcode project and file by file using Slather. Add warnings or fail the build if a minimum coverage are not achieved. It uses Slather Framework for calculate coverage, so it's required to configure the slather object before using it.
How does it look?
1 Error | |
---|---|
Total coverage less than 80% |
1 Warnings | |
---|---|
AppDelegate.swift has less than 50% code coverage |
Code coverage
Total coverage: 35.0
File | Coverage |
---|---|
AppDelegate.swift | 10.00 |
ViewController.swift | 20.00 |
ViewController2.swift | 30.00 |
ViewController3.swift | 40.00 |
ViewController4.swift | 50.00 |
ViewController5.swift | 60.00 |
Powered by Slather
Installation
$ gem install danger-slather
Usage
Just add this line to your Dangerfile
:
slather.configure("Path/to/my/project.xcodeproj", "MyScheme")
slather.notify_if_coverage_is_less_than(minimum_coverage: 60)
slather.notify_if_modified_file_is_less_than(minimum_coverage: 30)
slather.show_coverage
Development
- Clone this repo
- Run
bundle install
to setup dependencies. - Run
bundle exec rake spec
to run the tests. - Use
bundle exec guard
to automatically have tests run as you make changes. - Make your changes.