danger-rubocop 0.9.3 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c91b32a9db886ba98a9bb29e11e6fdec8b0aae1b344ef3bb41e281094e7cf2d4
4
- data.tar.gz: 6ce1784637f6ffd0de37de4aac28ff81c27154cbcf9b3e20ac46dab5c0ca0665
3
+ metadata.gz: 5363c39a9497dd46bb7268c9c8e1161604c90c5795cb790cd6affcd74a71c8aa
4
+ data.tar.gz: 4c9db849c7b8439aba6a5b7761daf57e7d871e18fd42a02f3a461e5ea23e80ff
5
5
  SHA512:
6
- metadata.gz: 560ace4a9f693783d80041b1ad88d4fe2dc3b4bcf946fced8195e30ce8f89ebc3cec698e9bdf09a9c3e377b7a7e7055f25710433ca4d1219583eb78e18ea513b
7
- data.tar.gz: b5f5ae9d8d821e75c95dbccaaf22858b7c8f1b790ec020711f55c0374dc8020d28393376c07337d500aaf87874234f9d6db6532447a7ac1bb7327d910da08def
6
+ metadata.gz: 02de948e9d1f6049d4b1516152e86b265106d715c48168412b9b2610a338b8f29c5d37d410a055caa5139ea634a2c226f62dc2caf72cc8083306e4d7d8012400
7
+ data.tar.gz: bdf55e66ef3307c0422acd50ff56691d303be15518667059e2bc8d9e0a14aeb060250f6ed878f2deca16594db4b0df6b21e0e7f4937e21f4a93901bc19b50429
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- danger-rubocop (0.9.1)
4
+ danger-rubocop (0.9.4)
5
5
  danger
6
6
  rubocop (~> 1.0)
7
7
 
@@ -10,18 +10,18 @@ GEM
10
10
  specs:
11
11
  addressable (2.7.0)
12
12
  public_suffix (>= 2.0.2, < 5.0)
13
- ast (2.4.1)
13
+ ast (2.4.2)
14
14
  bacon (1.2.0)
15
15
  claide (1.0.3)
16
16
  claide-plugins (0.9.2)
17
17
  cork
18
18
  nap
19
19
  open4 (~> 1.3)
20
- coderay (1.1.1)
20
+ coderay (1.1.3)
21
21
  colored2 (3.1.2)
22
22
  cork (0.3.0)
23
23
  colored2 (~> 3.1)
24
- danger (8.2.1)
24
+ danger (8.2.3)
25
25
  claide (~> 1.0)
26
26
  claide-plugins (>= 0.9.2)
27
27
  colored2 (~> 3.1)
@@ -33,110 +33,111 @@ GEM
33
33
  kramdown-parser-gfm (~> 1.0)
34
34
  no_proxy_fix
35
35
  octokit (~> 4.7)
36
- terminal-table (~> 1)
37
- diff-lcs (1.2.5)
38
- faraday (1.1.0)
36
+ terminal-table (>= 1, < 4)
37
+ diff-lcs (1.4.4)
38
+ faraday (1.4.1)
39
+ faraday-excon (~> 1.1)
40
+ faraday-net_http (~> 1.0)
41
+ faraday-net_http_persistent (~> 1.1)
39
42
  multipart-post (>= 1.2, < 3)
40
- ruby2_keywords
43
+ ruby2_keywords (>= 0.0.4)
44
+ faraday-excon (1.1.0)
41
45
  faraday-http-cache (2.2.0)
42
46
  faraday (>= 0.8)
43
- ffi (1.9.10)
47
+ faraday-net_http (1.0.1)
48
+ faraday-net_http_persistent (1.1.0)
49
+ ffi (1.15.0)
44
50
  formatador (0.2.5)
45
- git (1.7.0)
51
+ git (1.8.1)
46
52
  rchardet (~> 1.8)
47
- guard (2.14.0)
53
+ guard (2.16.2)
48
54
  formatador (>= 0.2.4)
49
55
  listen (>= 2.7, < 4.0)
50
- lumberjack (~> 1.0)
56
+ lumberjack (>= 1.0.12, < 2.0)
51
57
  nenv (~> 0.1)
52
58
  notiffany (~> 0.0)
53
59
  pry (>= 0.9.12)
54
60
  shellany (~> 0.0)
55
61
  thor (>= 0.18.1)
56
62
  guard-compat (1.2.1)
57
- guard-rspec (4.7.2)
63
+ guard-rspec (4.7.3)
58
64
  guard (~> 2.1)
59
65
  guard-compat (~> 1.1)
60
66
  rspec (>= 2.99.0, < 4.0)
61
- kramdown (2.3.0)
67
+ kramdown (2.3.1)
62
68
  rexml
63
69
  kramdown-parser-gfm (1.1.0)
64
70
  kramdown (~> 2.0)
65
71
  listen (3.0.7)
66
72
  rb-fsevent (>= 0.9.3)
67
73
  rb-inotify (>= 0.9.7)
68
- lumberjack (1.0.10)
69
- metaclass (0.0.4)
70
- method_source (0.8.2)
71
- mocha (1.1.0)
72
- metaclass (~> 0.0.1)
73
- mocha-on-bacon (0.2.2)
74
+ lumberjack (1.2.8)
75
+ method_source (1.0.0)
76
+ mocha (1.12.0)
77
+ mocha-on-bacon (0.2.3)
74
78
  mocha (>= 0.13.0)
75
79
  multipart-post (2.1.1)
76
80
  nap (1.1.0)
77
81
  nenv (0.3.0)
78
82
  no_proxy_fix (0.1.2)
79
- notiffany (0.1.0)
83
+ notiffany (0.1.3)
80
84
  nenv (~> 0.1)
81
85
  shellany (~> 0.0)
82
- octokit (4.19.0)
86
+ octokit (4.21.0)
83
87
  faraday (>= 0.9)
84
88
  sawyer (~> 0.8.0, >= 0.5.3)
85
89
  open4 (1.3.4)
86
90
  parallel (1.20.1)
87
- parser (2.7.2.0)
91
+ parser (3.0.1.1)
88
92
  ast (~> 2.4.1)
89
93
  prettybacon (0.0.2)
90
94
  bacon (~> 1.2)
91
- pry (0.10.3)
92
- coderay (~> 1.1.0)
93
- method_source (~> 0.8.1)
94
- slop (~> 3.4)
95
+ pry (0.14.1)
96
+ coderay (~> 1.1)
97
+ method_source (~> 1.0)
95
98
  public_suffix (4.0.6)
96
99
  rainbow (3.0.0)
97
- rake (13.0.1)
98
- rb-fsevent (0.9.7)
99
- rb-inotify (0.9.7)
100
- ffi (>= 0.5.0)
100
+ rake (13.0.3)
101
+ rb-fsevent (0.10.4)
102
+ rb-inotify (0.10.1)
103
+ ffi (~> 1.0)
101
104
  rchardet (1.8.0)
102
- regexp_parser (2.0.0)
103
- rexml (3.2.4)
104
- rspec (3.4.0)
105
- rspec-core (~> 3.4.0)
106
- rspec-expectations (~> 3.4.0)
107
- rspec-mocks (~> 3.4.0)
108
- rspec-core (3.4.4)
109
- rspec-support (~> 3.4.0)
110
- rspec-expectations (3.4.0)
105
+ regexp_parser (2.1.1)
106
+ rexml (3.2.5)
107
+ rspec (3.10.0)
108
+ rspec-core (~> 3.10.0)
109
+ rspec-expectations (~> 3.10.0)
110
+ rspec-mocks (~> 3.10.0)
111
+ rspec-core (3.10.1)
112
+ rspec-support (~> 3.10.0)
113
+ rspec-expectations (3.10.1)
111
114
  diff-lcs (>= 1.2.0, < 2.0)
112
- rspec-support (~> 3.4.0)
113
- rspec-mocks (3.4.1)
115
+ rspec-support (~> 3.10.0)
116
+ rspec-mocks (3.10.2)
114
117
  diff-lcs (>= 1.2.0, < 2.0)
115
- rspec-support (~> 3.4.0)
116
- rspec-support (3.4.1)
117
- rubocop (1.5.0)
118
+ rspec-support (~> 3.10.0)
119
+ rspec-support (3.10.2)
120
+ rubocop (1.14.0)
118
121
  parallel (~> 1.10)
119
- parser (>= 2.7.1.5)
122
+ parser (>= 3.0.0.0)
120
123
  rainbow (>= 2.2.2, < 4.0)
121
- regexp_parser (>= 2.0)
124
+ regexp_parser (>= 1.8, < 3.0)
122
125
  rexml
123
- rubocop-ast (>= 1.2.0)
126
+ rubocop-ast (>= 1.5.0, < 2.0)
124
127
  ruby-progressbar (~> 1.7)
125
- unicode-display_width (>= 1.4.0, < 2.0)
126
- rubocop-ast (1.3.0)
127
- parser (>= 2.7.1.5)
128
- ruby-progressbar (1.10.1)
129
- ruby2_keywords (0.0.2)
128
+ unicode-display_width (>= 1.4.0, < 3.0)
129
+ rubocop-ast (1.5.0)
130
+ parser (>= 3.0.1.1)
131
+ ruby-progressbar (1.11.0)
132
+ ruby2_keywords (0.0.4)
130
133
  sawyer (0.8.2)
131
134
  addressable (>= 2.3.5)
132
135
  faraday (> 0.8, < 2.0)
133
136
  shellany (0.0.1)
134
- slop (3.6.0)
135
- terminal-table (1.8.0)
136
- unicode-display_width (~> 1.1, >= 1.1.1)
137
- thor (0.19.1)
138
- unicode-display_width (1.7.0)
139
- yard (0.9.20)
137
+ terminal-table (1.6.0)
138
+ thor (1.1.0)
139
+ unicode-display_width (2.0.0)
140
+ yard (0.9.26)
140
141
 
141
142
  PLATFORMS
142
143
  ruby
data/lib/danger_plugin.rb CHANGED
@@ -145,7 +145,13 @@ module Danger
145
145
  end
146
146
 
147
147
  def fetch_files_to_lint(files = nil)
148
- to_lint = (files ? Dir.glob(files) : (git.modified_files + git.added_files))
148
+ to_lint = if files.nil?
149
+ # when files are renamed, git.modified_files contains the old name not the new one, so we need to do the convertion
150
+ renaming_map = (git.renamed_files || []).map { |e| [e[:before], e[:after]] }.to_h
151
+ (git.modified_files.map { |f| renaming_map[f] || f }) + git.added_files
152
+ else
153
+ Dir.glob(files)
154
+ end
149
155
  Shellwords.join(to_lint)
150
156
  end
151
157
  end
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module DangerRubocop
2
- VERSION = '0.9.3'.freeze
2
+ VERSION = '0.9.4'.freeze
3
3
  end
@@ -241,10 +241,12 @@ module Danger
241
241
  it 'handles a rubocop report for files changed in the PR' do
242
242
  allow(@rubocop.git).to receive(:added_files).and_return([])
243
243
  allow(@rubocop.git).to receive(:modified_files)
244
- .and_return(["spec/fixtures/another_ruby_file.rb"])
244
+ .and_return(["spec/fixtures/old_file_name.rb", "spec/fixtures/another_ruby_file.rb"])
245
+ allow(@rubocop.git).to receive(:renamed_files)
246
+ .and_return([{before: "spec/fixtures/old_file_name.rb", after: "spec/fixtures/new_file_name.rb"}])
245
247
 
246
248
  allow(@rubocop).to receive(:`)
247
- .with('bundle exec rubocop -f json --only-recognized-file-types spec/fixtures/another_ruby_file.rb')
249
+ .with('bundle exec rubocop -f json --only-recognized-file-types spec/fixtures/new_file_name.rb spec/fixtures/another_ruby_file.rb')
248
250
  .and_return(response_another_ruby_file)
249
251
 
250
252
  @rubocop.lint
@@ -259,6 +261,7 @@ module Danger
259
261
  allow(@rubocop.git).to receive(:modified_files)
260
262
  .and_return(['spec/fixtures/ruby_file.rb'])
261
263
  allow(@rubocop.git).to receive(:added_files).and_return([])
264
+ allow(@rubocop.git).to receive(:renamed_files).and_return([])
262
265
  allow(@rubocop).to receive(:`)
263
266
  .with('bundle exec rubocop -f json --only-recognized-file-types spec/fixtures/ruby_file.rb')
264
267
  .and_return(response_ruby_file)
@@ -281,6 +284,7 @@ EOS
281
284
  allow(@rubocop.git).to receive(:modified_files)
282
285
  .and_return(['spec/fixtures/ruby_file.rb'])
283
286
  allow(@rubocop.git).to receive(:added_files).and_return([])
287
+ allow(@rubocop.git).to receive(:renamed_files).and_return([])
284
288
  allow(@rubocop).to receive(:`)
285
289
  .with('bundle exec rubocop -f json --only-recognized-file-types spec/fixtures/ruby_file.rb')
286
290
  .and_return(response_ruby_file)
@@ -297,6 +301,7 @@ EOS
297
301
  allow(@rubocop.git).to receive(:modified_files)
298
302
  .and_return(['spec/fixtures/ruby_file.rb'])
299
303
  allow(@rubocop.git).to receive(:added_files).and_return([])
304
+ allow(@rubocop.git).to receive(:renamed_files).and_return([])
300
305
  allow(@rubocop).to receive(:`)
301
306
  .with('bundle exec rubocop -f json --only-recognized-file-types spec/fixtures/ruby_file.rb')
302
307
  .and_return(response_ruby_file)
@@ -319,6 +324,7 @@ EOS
319
324
  allow(@rubocop.git).to receive(:modified_files)
320
325
  .and_return(modified_files)
321
326
  allow(@rubocop.git).to receive(:added_files).and_return([])
327
+ allow(@rubocop.git).to receive(:renamed_files).and_return([])
322
328
 
323
329
  expect { @rubocop.lint }.not_to raise_error
324
330
  end
@@ -330,6 +336,7 @@ EOS
330
336
  allow(@rubocop.git).to receive(:modified_files)
331
337
  .and_return(['spec/fixtures/ruby_file.rb'])
332
338
  allow(@rubocop.git).to receive(:added_files).and_return([])
339
+ allow(@rubocop.git).to receive(:renamed_files).and_return([])
333
340
  allow(@rubocop).to receive(:`)
334
341
  .with('bundle exec rubocop -f json --only-recognized-file-types spec/fixtures/ruby_file.rb')
335
342
  .and_return(response_ruby_file)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger-rubocop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 0.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ash Furrow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-03 00:00:00.000000000 Z
11
+ date: 2021-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: danger
@@ -192,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
192
192
  - !ruby/object:Gem::Version
193
193
  version: '0'
194
194
  requirements: []
195
- rubygems_version: 3.0.8
195
+ rubygems_version: 3.0.2
196
196
  signing_key:
197
197
  specification_version: 4
198
198
  summary: A Danger plugin for running Ruby files through Rubocop.