A danger plugin to check Swift formatting using SwiftFormat.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
spec
.gitignore
.rubocop.yml
.travis.yml
Gemfile
Gemfile.lock
Guardfile
LICENSE.txt
README.md
Rakefile
danger-swiftformat.gemspec

README.md

danger-swiftformat Build Status Gem Version

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

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:

swiftformat.check_format(fail_on_error: true)

You can specify the swiftformat binary using the binary_path parameter:

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

You can specify additional swiftformat arguments using the additional_args parameter:

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.