danger-swiftformat 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +21 -8
- data/lib/swiftformat/gem_version.rb +1 -1
- data/lib/swiftformat/plugin.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6ee9731972b91a28abe4fc4b8c560508db30f76
|
4
|
+
data.tar.gz: 2f85cde2168bc1073d85e826a7b6645f43db271e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b1d0ff41b673f6c0cf6d0b97d17a70fb9721f858ab9d97f29a68af42e9e2089f37ee5dff6fe11edc80becd1c2222747146045040fc53b1777f55c0aeab91244
|
7
|
+
data.tar.gz: 5569c70f0570483713ee28a074cc07bf9027c04a29383651091a8fa8eab442c2bd42d466845411000e2af9021cc3137a80f6aee1fa2eb1efe28e4d3b9b58d6a1
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,26 +1,39 @@
|
|
1
|
-
# danger-swiftformat [](https://travis-ci.org/garriguv/danger-ruby-swiftformat)
|
1
|
+
# danger-swiftformat [](https://travis-ci.org/garriguv/danger-ruby-swiftformat) [](https://rubygems.org/gems/danger-swiftformat)
|
2
2
|
|
3
|
-
A [
|
3
|
+
A [Danger] plugin to check Swift formatting using [SwiftFormat].
|
4
4
|
|
5
5
|
This plugin is heavily inspired by [danger-swiftlint].
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
9
|
-
|
9
|
+
Add this line to your Gemfile:
|
10
|
+
|
11
|
+
require 'danger-swiftformat'
|
12
|
+
|
13
|
+
[SwiftFormat] also needs to be installed before you run Danger.
|
10
14
|
|
11
15
|
## Usage
|
12
16
|
|
13
|
-
Add
|
17
|
+
Add this to your `Dangerfile`
|
14
18
|
|
15
|
-
|
19
|
+
```ruby
|
20
|
+
swiftformat.check_format
|
21
|
+
```
|
16
22
|
|
17
|
-
|
23
|
+
By default, danger-swiftformat will check added and modified files.
|
24
|
+
|
25
|
+
If you want errors to fail Danger, you can use the `fail_on_error` option:
|
18
26
|
|
19
27
|
```ruby
|
20
|
-
swiftformat.binary_path = "/path/to/swiftformat" # optional, but recommended ;)
|
21
28
|
swiftformat.check_format(fail_on_error: true)
|
22
29
|
```
|
23
30
|
|
31
|
+
You can specify the `swiftformat` binary using the `binary_path` parameter:
|
32
|
+
|
33
|
+
```ruby
|
34
|
+
swiftformat.binary_path = "/path/to/swiftformat"
|
35
|
+
```
|
36
|
+
|
24
37
|
## Development
|
25
38
|
|
26
39
|
1. Clone this repo
|
@@ -29,6 +42,6 @@ swiftformat.check_format(fail_on_error: true)
|
|
29
42
|
4. Use `bundle exec guard` to automatically have tests run as you make changes.
|
30
43
|
5. Make your changes.
|
31
44
|
|
32
|
-
[
|
45
|
+
[Danger]: https://danger.systems/ruby/
|
33
46
|
[SwiftFormat]: https://github.com/nicklockwood/SwiftFormat
|
34
47
|
[danger-swiftlint]: https://github.com/ashfurrow/danger-ruby-swiftlint
|
data/lib/swiftformat/plugin.rb
CHANGED