danger-swiftformat 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +12 -7
- data/.travis.yml +4 -3
- data/Gemfile +1 -0
- data/Gemfile.lock +44 -40
- data/README.md +13 -1
- data/danger-swiftformat.gemspec +2 -1
- data/lib/swiftformat/gem_version.rb +1 -1
- data/lib/swiftformat/swiftformat.rb +4 -4
- data/scripts/release.sh +16 -0
- data/spec/fixtures/swiftformat_output.txt +7 -5
- data/spec/fixtures/swiftformat_output_with_errors.txt +8 -7
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 409a285528d5a1dba41e070e91342608f6b84730419d8827800c674826fccbaa
|
4
|
+
data.tar.gz: a85a7068013faac8cfebcd9d6634eb3655bc6c4859e2dff89031b54ccd00bded
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b19e8845a690be835165b418def72f025e3b3320d6fcbc30b7c601cd177f80ef6f5b1eb2da85651b5d0f59d9011182cbc57ef580cf0147f3af553e0d9eb2c49
|
7
|
+
data.tar.gz: eab0e48b9b4c8c953ec9fd89a0ed3a3a434ea6ce5041457dee6ceb867b10bf0c0caa9c2980df8f0233c8e1d115ae7a72035060bf2febccd1c0c772e0d86455e5
|
data/.rubocop.yml
CHANGED
@@ -13,20 +13,16 @@ Style/StringLiterals:
|
|
13
13
|
Style/ClassCheck:
|
14
14
|
EnforcedStyle: kind_of?
|
15
15
|
|
16
|
-
# It's better to be more explicit about the type
|
17
|
-
Style/BracesAroundHashParameters:
|
18
|
-
Enabled: false
|
19
|
-
|
20
16
|
# specs sometimes have useless assignments, which is fine
|
21
17
|
Lint/UselessAssignment:
|
22
18
|
Exclude:
|
23
19
|
- '**/spec/**/*'
|
24
20
|
|
25
21
|
# We could potentially enable the 2 below:
|
26
|
-
Layout/
|
22
|
+
Layout/FirstHashElementIndentation:
|
27
23
|
Enabled: false
|
28
24
|
|
29
|
-
Layout/
|
25
|
+
Layout/HashAlignment:
|
30
26
|
Enabled: false
|
31
27
|
|
32
28
|
# HoundCI doesn't like this rule
|
@@ -40,6 +36,15 @@ Style/DoubleNegation:
|
|
40
36
|
Style/FrozenStringLiteralComment:
|
41
37
|
Enabled: false
|
42
38
|
|
39
|
+
Style/HashEachMethods:
|
40
|
+
Enabled: false
|
41
|
+
|
42
|
+
Style/HashTransformKeys:
|
43
|
+
Enabled: true
|
44
|
+
|
45
|
+
Style/HashTransformValues:
|
46
|
+
Enabled: true
|
47
|
+
|
43
48
|
# Cop supports --auto-correct.
|
44
49
|
Lint/UnusedBlockArgument:
|
45
50
|
Enabled: false
|
@@ -133,7 +138,7 @@ Style/MixinGrouping:
|
|
133
138
|
Naming/FileName:
|
134
139
|
Enabled: false
|
135
140
|
|
136
|
-
Layout/
|
141
|
+
Layout/HeredocIndentation:
|
137
142
|
Enabled: false
|
138
143
|
|
139
144
|
Style/SpecialGlobalVars:
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
danger-swiftformat (0.
|
4
|
+
danger-swiftformat (0.7.0)
|
5
5
|
danger-plugin-api (~> 1.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
addressable (2.
|
11
|
-
public_suffix (>= 2.0.2, <
|
10
|
+
addressable (2.7.0)
|
11
|
+
public_suffix (>= 2.0.2, < 5.0)
|
12
12
|
ast (2.4.0)
|
13
|
-
claide (1.0.
|
13
|
+
claide (1.0.3)
|
14
14
|
claide-plugins (0.9.2)
|
15
15
|
cork
|
16
16
|
nap
|
@@ -19,14 +19,14 @@ GEM
|
|
19
19
|
colored2 (3.1.2)
|
20
20
|
cork (0.3.0)
|
21
21
|
colored2 (~> 3.1)
|
22
|
-
danger (6.
|
22
|
+
danger (6.2.2)
|
23
23
|
claide (~> 1.0)
|
24
24
|
claide-plugins (>= 0.9.2)
|
25
25
|
colored2 (~> 3.1)
|
26
26
|
cork (~> 0.1)
|
27
27
|
faraday (~> 0.9)
|
28
28
|
faraday-http-cache (~> 2.0)
|
29
|
-
git (~> 1.
|
29
|
+
git (~> 1.6)
|
30
30
|
kramdown (~> 2.0)
|
31
31
|
kramdown-parser-gfm (~> 1.0)
|
32
32
|
no_proxy_fix
|
@@ -39,10 +39,11 @@ GEM
|
|
39
39
|
multipart-post (>= 1.2, < 3)
|
40
40
|
faraday-http-cache (2.0.0)
|
41
41
|
faraday (~> 0.8)
|
42
|
-
ffi (1.
|
42
|
+
ffi (1.12.2)
|
43
43
|
formatador (0.2.5)
|
44
|
-
git (1.
|
45
|
-
|
44
|
+
git (1.6.0)
|
45
|
+
rchardet (~> 1.8)
|
46
|
+
guard (2.16.1)
|
46
47
|
formatador (>= 0.2.4)
|
47
48
|
listen (>= 2.7, < 4.0)
|
48
49
|
lumberjack (>= 1.0.12, < 2.0)
|
@@ -56,76 +57,79 @@ GEM
|
|
56
57
|
guard (~> 2.1)
|
57
58
|
guard-compat (~> 1.1)
|
58
59
|
rspec (>= 2.99.0, < 4.0)
|
59
|
-
jaro_winkler (1.5.
|
60
|
+
jaro_winkler (1.5.4)
|
60
61
|
kramdown (2.1.0)
|
61
62
|
kramdown-parser-gfm (1.1.0)
|
62
63
|
kramdown (~> 2.0)
|
63
|
-
listen (3.1
|
64
|
-
rb-fsevent (~> 0.
|
65
|
-
rb-inotify (~> 0.9, >= 0.9.
|
66
|
-
|
67
|
-
lumberjack (1.0.13)
|
64
|
+
listen (3.2.1)
|
65
|
+
rb-fsevent (~> 0.10, >= 0.10.3)
|
66
|
+
rb-inotify (~> 0.9, >= 0.9.10)
|
67
|
+
lumberjack (1.2.4)
|
68
68
|
method_source (0.9.2)
|
69
69
|
multipart-post (2.1.1)
|
70
70
|
nap (1.1.0)
|
71
71
|
nenv (0.3.0)
|
72
72
|
no_proxy_fix (0.1.2)
|
73
|
-
notiffany (0.1.
|
73
|
+
notiffany (0.1.3)
|
74
74
|
nenv (~> 0.1)
|
75
75
|
shellany (~> 0.0)
|
76
|
-
octokit (4.
|
76
|
+
octokit (4.16.0)
|
77
|
+
faraday (>= 0.9)
|
77
78
|
sawyer (~> 0.8.0, >= 0.5.3)
|
78
79
|
open4 (1.3.4)
|
79
|
-
parallel (1.
|
80
|
-
parser (2.
|
80
|
+
parallel (1.19.1)
|
81
|
+
parser (2.7.0.2)
|
81
82
|
ast (~> 2.4.0)
|
82
83
|
pry (0.12.2)
|
83
84
|
coderay (~> 1.1.0)
|
84
85
|
method_source (~> 0.9.0)
|
85
|
-
public_suffix (
|
86
|
+
public_suffix (4.0.3)
|
86
87
|
rainbow (3.0.0)
|
87
88
|
rake (12.3.3)
|
88
89
|
rb-fsevent (0.10.3)
|
89
|
-
rb-inotify (0.10.
|
90
|
+
rb-inotify (0.10.1)
|
90
91
|
ffi (~> 1.0)
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
rspec-
|
95
|
-
|
96
|
-
rspec-
|
97
|
-
rspec-
|
92
|
+
rchardet (1.8.0)
|
93
|
+
rexml (3.2.4)
|
94
|
+
rspec (3.9.0)
|
95
|
+
rspec-core (~> 3.9.0)
|
96
|
+
rspec-expectations (~> 3.9.0)
|
97
|
+
rspec-mocks (~> 3.9.0)
|
98
|
+
rspec-core (3.9.1)
|
99
|
+
rspec-support (~> 3.9.1)
|
100
|
+
rspec-expectations (3.9.0)
|
98
101
|
diff-lcs (>= 1.2.0, < 2.0)
|
99
|
-
rspec-support (~> 3.
|
100
|
-
rspec-mocks (3.
|
102
|
+
rspec-support (~> 3.9.0)
|
103
|
+
rspec-mocks (3.9.1)
|
101
104
|
diff-lcs (>= 1.2.0, < 2.0)
|
102
|
-
rspec-support (~> 3.
|
103
|
-
rspec-support (3.
|
104
|
-
rubocop (0.
|
105
|
+
rspec-support (~> 3.9.0)
|
106
|
+
rspec-support (3.9.2)
|
107
|
+
rubocop (0.80.0)
|
105
108
|
jaro_winkler (~> 1.5.1)
|
106
109
|
parallel (~> 1.10)
|
107
|
-
parser (>= 2.
|
110
|
+
parser (>= 2.7.0.1)
|
108
111
|
rainbow (>= 2.2.2, < 4.0)
|
112
|
+
rexml
|
109
113
|
ruby-progressbar (~> 1.7)
|
110
114
|
unicode-display_width (>= 1.4.0, < 1.7)
|
111
115
|
ruby-progressbar (1.10.1)
|
112
|
-
ruby_dep (1.5.0)
|
113
116
|
sawyer (0.8.2)
|
114
117
|
addressable (>= 2.3.5)
|
115
118
|
faraday (> 0.8, < 2.0)
|
116
119
|
shellany (0.0.1)
|
117
120
|
terminal-table (1.8.0)
|
118
121
|
unicode-display_width (~> 1.1, >= 1.1.1)
|
119
|
-
thor (0.
|
120
|
-
unicode-display_width (1.6.
|
121
|
-
yard (0.9.
|
122
|
+
thor (1.0.1)
|
123
|
+
unicode-display_width (1.6.1)
|
124
|
+
yard (0.9.24)
|
122
125
|
|
123
126
|
PLATFORMS
|
124
127
|
ruby
|
125
128
|
|
126
129
|
DEPENDENCIES
|
127
|
-
bundler (~> 1
|
130
|
+
bundler (~> 2.1)
|
128
131
|
danger-swiftformat!
|
132
|
+
faraday (= 0.15.4)
|
129
133
|
guard (~> 2.14)
|
130
134
|
guard-rspec (~> 4.7)
|
131
135
|
listen (~> 3.1)
|
@@ -136,4 +140,4 @@ DEPENDENCIES
|
|
136
140
|
yard (~> 0.9)
|
137
141
|
|
138
142
|
BUNDLED WITH
|
139
|
-
1.
|
143
|
+
2.1.4
|
data/README.md
CHANGED
@@ -8,7 +8,9 @@ This plugin is heavily inspired by [danger-swiftlint].
|
|
8
8
|
|
9
9
|
Add this line to your Gemfile:
|
10
10
|
|
11
|
-
|
11
|
+
```ruby
|
12
|
+
gem 'danger-swiftformat'
|
13
|
+
```
|
12
14
|
|
13
15
|
[SwiftFormat] also needs to be installed before you run Danger.
|
14
16
|
|
@@ -60,6 +62,16 @@ The `exclude` option takes an array of glob patterns; you can find additional do
|
|
60
62
|
4. Use `bundle exec guard` to automatically have tests run as you make changes.
|
61
63
|
5. Make your changes.
|
62
64
|
|
65
|
+
## Releasing a new version
|
66
|
+
|
67
|
+
Use the release.sh script:
|
68
|
+
|
69
|
+
```shell
|
70
|
+
./scripts/release.sh
|
71
|
+
```
|
72
|
+
|
73
|
+
Then bump the gem to the next patch version.
|
74
|
+
|
63
75
|
[Danger]: https://danger.systems/ruby/
|
64
76
|
[SwiftFormat]: https://github.com/nicklockwood/SwiftFormat
|
65
77
|
[danger-swiftlint]: https://github.com/ashfurrow/danger-ruby-swiftlint
|
data/danger-swiftformat.gemspec
CHANGED
@@ -12,6 +12,7 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.summary = %q{A danger plugin for checking Swift formatting using SwiftFormat.}
|
13
13
|
spec.homepage = 'https://github.com/garriguv/danger-swiftformat'
|
14
14
|
spec.license = 'MIT'
|
15
|
+
spec.metadata = { "github_repo" => "ssh://github.com/garriguv/danger-ruby-swiftformat" }
|
15
16
|
|
16
17
|
spec.files = `git ls-files`.split($/)
|
17
18
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
@@ -21,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
21
22
|
spec.add_runtime_dependency 'danger-plugin-api', '~> 1.0'
|
22
23
|
|
23
24
|
# General ruby development
|
24
|
-
spec.add_development_dependency 'bundler', '~> 1
|
25
|
+
spec.add_development_dependency 'bundler', '~> 2.1'
|
25
26
|
spec.add_development_dependency 'rake', '~> 12.3'
|
26
27
|
|
27
28
|
# Testing support
|
@@ -41,7 +41,7 @@ module Danger
|
|
41
41
|
}
|
42
42
|
end
|
43
43
|
|
44
|
-
ERRORS_REGEX = /
|
44
|
+
ERRORS_REGEX = /Formatting\s(.*)\n-- rules applied:(.*)$/.freeze
|
45
45
|
|
46
46
|
def errors(output)
|
47
47
|
errors = []
|
@@ -49,14 +49,14 @@ module Danger
|
|
49
49
|
next if match.count < 2
|
50
50
|
|
51
51
|
errors << {
|
52
|
-
file: match[
|
53
|
-
rules: match[
|
52
|
+
file: match[0],
|
53
|
+
rules: match[1].split(",").map(&:strip)
|
54
54
|
}
|
55
55
|
end
|
56
56
|
errors
|
57
57
|
end
|
58
58
|
|
59
|
-
RUNTIME_REGEX = /.*
|
59
|
+
RUNTIME_REGEX = /.*SwiftFormat completed.*(.+\..+)s/.freeze
|
60
60
|
|
61
61
|
def run_time(output)
|
62
62
|
if RUNTIME_REGEX.match(output)
|
data/scripts/release.sh
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
set -euo pipefail
|
4
|
+
|
5
|
+
version=$(cat lib/swiftformat/gem_version.rb | grep -o "\d\.\d\.\d")
|
6
|
+
|
7
|
+
echo "Releasing version ${version}"
|
8
|
+
|
9
|
+
echo "Releasing to rubygems.org"
|
10
|
+
bundle exec rake release
|
11
|
+
|
12
|
+
echo "Releasing to GitHub Package Registry"
|
13
|
+
gem push \
|
14
|
+
--key github \
|
15
|
+
--host https://rubygems.pkg.github.com/garriguv \
|
16
|
+
pkg/danger-swiftformat-${version}.gem
|
@@ -1,9 +1,11 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
Running SwiftFormat...
|
2
|
+
(dryrun mode - no files will be changed.)
|
3
|
+
Formatting /Users/garriguv/FirstClass.swift
|
3
4
|
-- no changes
|
4
|
-
|
5
|
+
Formatting /Users/garriguv/FileWithErrors.swift
|
5
6
|
-- no changes
|
6
|
-
|
7
|
+
Formatting /Users/garriguv/OtherFile.swift
|
7
8
|
-- no changes
|
8
9
|
|
9
|
-
|
10
|
+
SwiftFormat completed in 0.08s.
|
11
|
+
0/3 files would have been formatted.
|
@@ -1,10 +1,11 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
Running SwiftFormat...
|
2
|
+
(dryrun mode - no files will be changed.)
|
3
|
+
Formatting /Users/garriguv/FirstClass.swift
|
3
4
|
-- no changes
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
formatting /Users/garriguv/OtherFile.swift
|
5
|
+
Formatting /Users/garriguv/FileWithErrors.swift
|
6
|
+
-- rules applied: consecutiveBlankLines, spaceAroundParens, trailingSpace
|
7
|
+
Formatting /Users/garriguv/OtherFile.swift
|
8
8
|
-- no changes
|
9
9
|
|
10
|
-
|
10
|
+
SwiftFormat completed in 0.08s.
|
11
|
+
1/3 files would have been formatted.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: danger-swiftformat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vincent Garrigues
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: danger-plugin-api
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '1
|
33
|
+
version: '2.1'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '1
|
40
|
+
version: '2.1'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -173,6 +173,7 @@ files:
|
|
173
173
|
- lib/swiftformat/gem_version.rb
|
174
174
|
- lib/swiftformat/plugin.rb
|
175
175
|
- lib/swiftformat/swiftformat.rb
|
176
|
+
- scripts/release.sh
|
176
177
|
- spec/fixtures/swiftformat_output.txt
|
177
178
|
- spec/fixtures/swiftformat_output_bad.txt
|
178
179
|
- spec/fixtures/swiftformat_output_with_errors.txt
|
@@ -182,7 +183,8 @@ files:
|
|
182
183
|
homepage: https://github.com/garriguv/danger-swiftformat
|
183
184
|
licenses:
|
184
185
|
- MIT
|
185
|
-
metadata:
|
186
|
+
metadata:
|
187
|
+
github_repo: ssh://github.com/garriguv/danger-ruby-swiftformat
|
186
188
|
post_install_message:
|
187
189
|
rdoc_options: []
|
188
190
|
require_paths:
|
@@ -198,7 +200,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
198
200
|
- !ruby/object:Gem::Version
|
199
201
|
version: '0'
|
200
202
|
requirements: []
|
201
|
-
rubygems_version: 3.0.
|
203
|
+
rubygems_version: 3.0.3
|
202
204
|
signing_key:
|
203
205
|
specification_version: 4
|
204
206
|
summary: A danger plugin for checking Swift formatting using SwiftFormat.
|