A Danger plugin that shows all build errors, warnings and unit tests results generated from xcodebuild.
Clone or download
marcelofabri Merge pull request #39 from diogot/marcelofabri-patch-1
 Add link to danger-swift-xcodesummary on README
Latest commit 661bd03 Jan 14, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib Bump version to 0.5.0 Mar 5, 2018
spec Update gems Mar 5, 2018
.gitignore Ignore yardoc May 10, 2017
.rubocop.yml Fix warnings Mar 4, 2018
.travis.yml Drop ruby 2.0 support due to dependency needs Jan 7, 2018
Gemfile Making rubocop happy Jan 24, 2017
Gemfile.lock Bump version to 0.5.0 Mar 5, 2018
Guardfile Initial commit Jul 19, 2016
LICENSE.txt Added @marcelofabri as copyright holder Aug 28, 2016
README.md Add link Jan 14, 2019
Rakefile Initial commit Jul 19, 2016
danger-xcode_summary.gemspec Fix rubocop warnings Apr 25, 2017

README.md

danger-xcode_summary

License Gem Version Build Status Dependency Status

A Danger plugin that shows all build errors, warnings and unit tests results generated from xcodebuild.

You need to use xcpretty with xcpretty-json-formatter to generate a JSON file that this plugin can read.

Using danger-swift? You may want to take a look at danger-swift-xcodesummary.

How does it look?

1 Error
🚫 MyWeightTests.MyWeightTests: testError, failed - :w:
MyWeightTests/MyWeightTests.swift#L26
2 Warnings
⚠️ MyWeight/ViewController.swift#L35: initialization of immutable value ‘bla’ was never used; consider replacing with assignment to ‘_’ or removing it
let bla = "unused variable"
⚠️ Bla.m#L32: Value stored to ‘theme’ is never read
theme = *ptr++;
1 Message
📖 Executed 5 tests, with 1 failure (0 unexpected) in 0.032 (0.065) seconds

Installation

Add this line to your Gemfile:

gem 'danger-xcode_summary'

Usage

Just add this line to your Dangerfile:

xcode_summary.report 'xcodebuild.json'

You can also ignore warnings from certain files by setting ignored_files: Warning: ignored_files patterns applied on relative paths.

# Ignoring warnings from Pods
xcode_summary.ignored_files = 'Pods/**'

# Ignoring specific warnings
xcode_summary.ignored_results { |result|
  result.message.start_with? 'ld' # Ignore ld_warnings
}

xcode_summary.report 'xcodebuild.json'

You can use ignores_warnings to supress warnings and shows only errors.

xcode_summary.ignores_warnings = true

You can use inline_mode. When this value is enabled, each warnings and errors are commented on each lines.

# Comment on each lines
xcode_summary.inline_mode = true
xcode_summary.report 'xcodebuild.json'

You can get warning and error number by calling warning_error_count. The return will be a JSON string contains warning and error count, e.g {"warnings":1,"errors":3}:

result = xcode_summary.warning_error_count 'xcodebuild.json'

License

danger-xcode_summary is released under the MIT license. See LICENSE.txt for details.

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.