Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/diogot/danger-xcode_summary
A Danger plugin that shows all build errors, warnings and unit tests results generated from xcodebuild.
https://github.com/diogot/danger-xcode_summary
danger danger-xcode-summary hacktoberfest xcode xcpretty-json-formatter
Last synced: 2 days ago
JSON representation
A Danger plugin that shows all build errors, warnings and unit tests results generated from xcodebuild.
- Host: GitHub
- URL: https://github.com/diogot/danger-xcode_summary
- Owner: diogot
- License: mit
- Created: 2016-07-19T03:56:24.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-09-04T11:35:15.000Z (4 months ago)
- Last Synced: 2024-12-13T08:02:44.660Z (10 days ago)
- Topics: danger, danger-xcode-summary, hacktoberfest, xcode, xcpretty-json-formatter
- Language: Ruby
- Homepage:
- Size: 713 KB
- Stars: 136
- Watchers: 3
- Forks: 42
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-danger - danger-xcode_summary - A Danger plugin showing all build errors, warnings and unit tests results from xcodebuild. (Plugins / Ruby (danger))
README
# danger-xcode_summary
[![License](http://img.shields.io/badge/license-MIT-green.svg?style=flat)](LICENSE.txt)
[![Gem Version](https://badge.fury.io/rb/danger-xcode_summary.svg)](https://badge.fury.io/rb/danger-xcode_summary)
[![Build Status](https://travis-ci.org/diogot/danger-xcode_summary.svg?branch=master)](https://travis-ci.org/diogot/danger-xcode_summary)A [Danger](http://danger.systems) plugin that shows all build errors, warnings and unit tests results generated from `xcodebuild`.
## 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
π
TestTarget: Executed 5 tests, with 1 failure (0 unexpected) in 0.032 (0.065) seconds
## Installation
Add this line to your Gemfile:
```ruby
gem 'danger-xcode_summary'
```## Usage
Just add this line to your `Dangerfile`:
```ruby
xcode_summary.report 'MyApp.xcresult'
```You need to pass the path of the `xcresult` generated after compiling your app.
By default, this is inside the `DerivedData` for your project, but you can use the `-resultBundlePath`
flag when calling `xcodebuild` to customize its path. You can read more about it in this [blog post from the folks at PSPDFKit](https://pspdfkit.com/blog/2021/deflaking-ci-tests-with-xcresults/#using-xcresult-bundles).You can also ignore warnings from certain files by setting `ignored_files`:
Warning: `ignored_files` patterns applied on relative paths.```ruby
# Ignoring warnings from Pods
xcode_summary.ignored_files = 'Pods/**'# Ignoring specific warnings
xcode_summary.ignored_results { |result|
result.message.include? 'ld' # Ignore ld_warnings
}xcode_summary.report 'MyApp.xcresult'
```You can use `ignores_warnings` to supress warnings and shows only errors.
```ruby
xcode_summary.ignores_warnings = true
```You can use `inline_mode`.
When this value is enabled, each warnings and errors are commented on each lines.```ruby
# Comment on each lines
xcode_summary.inline_mode = true
xcode_summary.report 'MyApp.xcresult'
```You can use `strict` to reporting errors as warnings thereby don't block merge PR.
```ruby
# If value is `false`, then errors will be reporting as warnings
xcode_summary.strict = false
```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}`:
```ruby
result = xcode_summary.warning_error_count 'MyApp.xcresult'
```## License
danger-xcode_summary is released under the MIT license. See [LICENSE.txt](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.