Skip to content

Danger plugin to validate the code coverage of the files changed in a pull request

License

Notifications You must be signed in to change notification settings

Esakkiraja-Pothikannan/danger-xcov

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xcov Logo


Twitter: @nakiostudio License Gem Gem Downloads

danger-xcov is the Danger plugin of xcov, a friendly visualizer for Xcode's code coverage files.

Installation

sudo gem install danger-xcov

Usage

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_coverage_percentage_for_changed_files: 80,
   ignore_list_of_minimum_coverage_percentage_for_changed_files: ['View', 'State']
)

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_coverage_percentage_for_changed_files: 80,
  ignore_list_of_minimum_coverage_percentage_for_changed_files: ['View', 'State']
)

# Do some custom filtering with the report here

# Post markdown report
xcov.output_report(report)

Updates in the plugin

  • Added minimum_coverage_percentage_for_changed_files parameter to allow minimum coverage for new and modified files only.
  • Added ignore_list_of_minimum_coverage_percentage_for_changed_files parameter to allow skipping files based on the architecture of the project.
    • For example, if the parameter is like ignore_list_of_minimum_coverage_percentage_for_changed_files: ['View', 'State'], then any filename which contains the word View or State will be skipped from this coverage check.

Linking this custom support to your repo

Add this to your gemfile instead of danger-xcov, point it to this fork.

gem 'danger-xcov', :git => 'https://github.com/rakutentech/danger-xcov.git'

License

This project is licensed under the terms of the MIT license. See the LICENSE file.

About

Danger plugin to validate the code coverage of the files changed in a pull request

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%