Code Monkey home page Code Monkey logo

danger-xcode_summary's Introduction

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.

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.

danger-xcode_summary's People

Contributors

diogot avatar fsaragoca avatar giginet avatar guo-li avatar klaaspieter avatar makadaw avatar marcelofabri avatar stevethomp avatar vk12 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.