0.03
No release in over 3 years
Low commit activity in last 3 years
Danger plugin to Slather code coverage framework
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
~> 2.14
= 3.0.7
~> 1.2
~> 0.9
~> 10.0
~> 3.4
~> 0.41
~> 0.8

Runtime

 Project Readme

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

First configure the slather object:

slather.configure("Path/to/my/project.xcodeproj", "MyScheme")

For a more complex case:

slather.configure("Path/to/my/project.xcodeproj", "MyScheme", options: {
  workspace: 'Path/to/my/workspace.xcworkspace',
  build_directory: 'Path/to/my/build_directory',
  ignore_list: ['ignore file 1', 'ignore file 2'],
  ci_service: :travis,
  coverage_access_token: 'acc123123123123',
  coverage_service: :terminal,
  source_directory: 'Path/to/my/source_directory',
  output_directory: 'Path/to/my/output_directory',
  input_format: 'profdata',
  binary_file: 'Path/to/my/output_directory',
  decimals: 2
  post: false      
})

For a more complete documentation of all support configuration see Slather

Than just add this line to your Dangerfile:

slather.notify_if_coverage_is_less_than(minimum_coverage: 80)
slather.notify_if_modified_file_is_less_than(minimum_coverage: 60)
slather.show_coverage

Development

  1. Clone this repo
  2. Run bundle install to setup dependencies.
  3. Run bundle exec rake spec to run the tests.
  4. Use bundle exec guard to automatically have tests run as you make changes.
  5. Make your changes.