danger-swiftformat 0.6.0 → 0.7.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7c9b3279bd74c07c0484451302265163c566fb8cf833ee02f11d19c718452a08
4
- data.tar.gz: b36e4a5b90fff935710634fa63d743b9a538b60830df7fd7b0bdf854dc3b461f
3
+ metadata.gz: 409a285528d5a1dba41e070e91342608f6b84730419d8827800c674826fccbaa
4
+ data.tar.gz: a85a7068013faac8cfebcd9d6634eb3655bc6c4859e2dff89031b54ccd00bded
5
5
  SHA512:
6
- metadata.gz: 040feb0a05ffa56ac333620d1a162cfdc660743e0ff3dc26ba6223a437e4fab52b218c23d89c3bc6ff889793887ced05dc45e1f68b411f4184d2df698f58aacf
7
- data.tar.gz: 44ab68d8cbd5b545bab694b4463c2232c269a5ab1bb6e5295c59f82d98f9f15445b3993bd96e4323babde11c1acc6b8b160ff44d7b33cf48b013c0b67f22c324
6
+ metadata.gz: 8b19e8845a690be835165b418def72f025e3b3320d6fcbc30b7c601cd177f80ef6f5b1eb2da85651b5d0f59d9011182cbc57ef580cf0147f3af553e0d9eb2c49
7
+ data.tar.gz: eab0e48b9b4c8c953ec9fd89a0ed3a3a434ea6ce5041457dee6ceb867b10bf0c0caa9c2980df8f0233c8e1d115ae7a72035060bf2febccd1c0c772e0d86455e5
@@ -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/IndentFirstHashElement:
22
+ Layout/FirstHashElementIndentation:
27
23
  Enabled: false
28
24
 
29
- Layout/AlignHash:
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/IndentHeredoc:
141
+ Layout/HeredocIndentation:
137
142
  Enabled: false
138
143
 
139
144
  Style/SpecialGlobalVars:
@@ -7,9 +7,10 @@ before_install:
7
7
 
8
8
  rvm:
9
9
  - 2.3.8
10
- - 2.4.4
11
- - 2.5.3
12
- - 2.6.3
10
+ - 2.4.9
11
+ - 2.5.7
12
+ - 2.6.5
13
+ - 2.7.0
13
14
 
14
15
  script:
15
16
  - bundle exec rake spec
data/Gemfile CHANGED
@@ -2,3 +2,4 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in danger-swiftformat.gemspec
4
4
  gemspec
5
+ gem "faraday", "0.15.4"
@@ -1,16 +1,16 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- danger-swiftformat (0.6.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.6.0)
11
- public_suffix (>= 2.0.2, < 4.0)
10
+ addressable (2.7.0)
11
+ public_suffix (>= 2.0.2, < 5.0)
12
12
  ast (2.4.0)
13
- claide (1.0.2)
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.0.9)
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.5)
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.11.1)
42
+ ffi (1.12.2)
43
43
  formatador (0.2.5)
44
- git (1.5.0)
45
- guard (2.15.0)
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.3)
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.5)
64
- rb-fsevent (~> 0.9, >= 0.9.4)
65
- rb-inotify (~> 0.9, >= 0.9.7)
66
- ruby_dep (~> 1.2)
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.1)
73
+ notiffany (0.1.3)
74
74
  nenv (~> 0.1)
75
75
  shellany (~> 0.0)
76
- octokit (4.14.0)
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.17.0)
80
- parser (2.6.3.0)
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 (3.1.1)
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.0)
90
+ rb-inotify (0.10.1)
90
91
  ffi (~> 1.0)
91
- rspec (3.8.0)
92
- rspec-core (~> 3.8.0)
93
- rspec-expectations (~> 3.8.0)
94
- rspec-mocks (~> 3.8.0)
95
- rspec-core (3.8.2)
96
- rspec-support (~> 3.8.0)
97
- rspec-expectations (3.8.4)
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.8.0)
100
- rspec-mocks (3.8.1)
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.8.0)
103
- rspec-support (3.8.2)
104
- rubocop (0.73.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.6)
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.20.3)
120
- unicode-display_width (1.6.0)
121
- yard (0.9.20)
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.16)
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.17.2
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
- gem 'danger-swiftformat'
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
@@ -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.16'
25
+ spec.add_development_dependency 'bundler', '~> 2.1'
25
26
  spec.add_development_dependency 'rake', '~> 12.3'
26
27
 
27
28
  # Testing support
@@ -1,3 +1,3 @@
1
1
  module Swiftformat
2
- VERSION = "0.6.0".freeze
2
+ VERSION = "0.7.0".freeze
3
3
  end
@@ -41,7 +41,7 @@ module Danger
41
41
  }
42
42
  end
43
43
 
44
- ERRORS_REGEX = /rules applied:(.*)\n.*updated (.*)$/.freeze
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[1],
53
- rules: match[0].split(",").map(&:strip)
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 = /.*swiftformat completed.*(.+\..+)s/.freeze
59
+ RUNTIME_REGEX = /.*SwiftFormat completed.*(.+\..+)s/.freeze
60
60
 
61
61
  def run_time(output)
62
62
  if RUNTIME_REGEX.match(output)
@@ -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
- running swiftformat...
2
- formatting /Users/garriguv/FirstClass.swift
1
+ Running SwiftFormat...
2
+ (dryrun mode - no files will be changed.)
3
+ Formatting /Users/garriguv/FirstClass.swift
3
4
  -- no changes
4
- formatting /Users/garriguv/FileWithErrors.swift
5
+ Formatting /Users/garriguv/FileWithErrors.swift
5
6
  -- no changes
6
- formatting /Users/garriguv/OtherFile.swift
7
+ Formatting /Users/garriguv/OtherFile.swift
7
8
  -- no changes
8
9
 
9
- swiftformat completed. 0/3 files would have been updated in 0.08s
10
+ SwiftFormat completed in 0.08s.
11
+ 0/3 files would have been formatted.
@@ -1,10 +1,11 @@
1
- running swiftformat...
2
- formatting /Users/garriguv/FirstClass.swift
1
+ Running SwiftFormat...
2
+ (dryrun mode - no files will be changed.)
3
+ Formatting /Users/garriguv/FirstClass.swift
3
4
  -- no changes
4
- formatting /Users/garriguv/FileWithErrors.swift
5
- -- rules applied: consecutiveBlankLines, spaceAroundParens, trailingSpace
6
- would have updated /Users/garriguv/FileWithErrors.swift
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
- swiftformat completed. 1/3 files would have been updated in 0.08s
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.6.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: 2019-07-25 00:00:00.000000000 Z
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.16'
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.16'
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.1
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.