Sha256: b708a7b0779809db960bc881a5122a12bf348c48d9539925845c5c80b36e8b94

Contents?: true

Size: 1.5 KB

Versions: 9

Compression:

Stored size: 1.5 KB

Contents

# danger-swiftformat [![Build Status](https://travis-ci.org/garriguv/danger-ruby-swiftformat.svg?branch=master)](https://travis-ci.org/garriguv/danger-ruby-swiftformat) [![Gem Version](https://badge.fury.io/rb/danger-swiftformat.svg)](https://rubygems.org/gems/danger-swiftformat)

A [Danger] plugin to check Swift formatting using [SwiftFormat].

This plugin is heavily inspired by [danger-swiftlint].

## Installation

Add this line to your Gemfile:

    require 'danger-swiftformat'

[SwiftFormat] also needs to be installed before you run Danger.

## Usage

Add this to your `Dangerfile`

```ruby
swiftformat.check_format
```

By default, danger-swiftformat will check added and modified files.

If you want errors to fail Danger, you can use the `fail_on_error` option:

```ruby
swiftformat.check_format(fail_on_error: true)
```

You can specify the `swiftformat` binary using the `binary_path` parameter:

```ruby
swiftformat.binary_path = "/path/to/swiftformat"
```

You can specify additional `swiftformat` arguments using the `additional_args` parameter:

```ruby
swiftformat.additional_args = "--indent tab --self insert"
```

## 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]: https://danger.systems/ruby/
[SwiftFormat]: https://github.com/nicklockwood/SwiftFormat
[danger-swiftlint]: https://github.com/ashfurrow/danger-ruby-swiftlint

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
danger-swiftformat-0.4.0 README.md
danger-swiftformat-0.3.6 README.md
danger-swiftformat-0.3.5 README.md
danger-swiftformat-0.3.4 README.md
danger-swiftformat-0.3.3 README.md
danger-swiftformat-0.3.2 README.md
danger-swiftformat-0.3.1 README.md
danger-swiftformat-0.3.0 README.md
danger-swiftformat-0.2.0 README.md