README.md in danger-swiftformat-0.4.0 vs README.md in danger-swiftformat-0.5.0
- old
+ new
@@ -6,11 +6,11 @@
## Installation
Add this line to your Gemfile:
- require 'danger-swiftformat'
+ gem 'danger-swiftformat'
[SwiftFormat] also needs to be installed before you run Danger.
## Usage
@@ -20,10 +20,12 @@
swiftformat.check_format
```
By default, danger-swiftformat will check added and modified files.
+## Options and parameters
+
If you want errors to fail Danger, you can use the `fail_on_error` option:
```ruby
swiftformat.check_format(fail_on_error: true)
```
@@ -37,9 +39,19 @@
You can specify additional `swiftformat` arguments using the `additional_args` parameter:
```ruby
swiftformat.additional_args = "--indent tab --self insert"
```
+
+By default, `danger-swiftformat` will run on any modified or created file ending in `.swift`. If you'd like to exclude
+certain directories or files such as `Pods`, you can use the `exclude` parameter:
+
+```ruby
+swiftformat.exclude = %w(Pods/** Carthage/** Sources/Nope.swift **/*_autogenerated.swift)
+```
+
+The `exclude` option takes an array of glob patterns; you can find additional documentation on the patterns
+[here](https://ruby-doc.org/core-2.6.3/File.html#method-c-fnmatch).
## Development
1. Clone this repo
2. Run `bundle install` to setup dependencies.