danger-pmd 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,15 +3,15 @@
3
3
  require_relative "../spec_helper"
4
4
 
5
5
  module Pmd
6
- require "oga"
6
+ require 'oga'
7
7
 
8
8
  describe PmdFile do
9
- it "should initialize relative path ending with file separator" do
10
- xml = Oga.parse_xml(File.open("spec/fixtures/pmd_report.xml"))
11
- pmd_file = PmdFile.new("/Users/developer/sample/", xml.xpath("//file").first)
9
+ it 'should initialize relative path ending with file separator' do
10
+ xml = Oga.parse_xml(File.open('spec/fixtures/pmd_report.xml'))
11
+ pmd_file = PmdFile.new('/Users/developer/sample/', xml.xpath('//file').first)
12
12
 
13
- expect(pmd_file.absolute_path).to eq("/Users/developer/sample/app/src/main/java/com/android/sample/Tools.java")
14
- expect(pmd_file.relative_path).to eq("app/src/main/java/com/android/sample/Tools.java")
13
+ expect(pmd_file.absolute_path).to eq('/Users/developer/sample/app/src/main/java/com/android/sample/Tools.java')
14
+ expect(pmd_file.relative_path).to eq('app/src/main/java/com/android/sample/Tools.java')
15
15
  expect(pmd_file.violations).not_to be_nil
16
16
  expect(pmd_file.violations.length).to eq(1)
17
17
  expect(pmd_file.violations.first).not_to be_nil
@@ -19,12 +19,12 @@ module Pmd
19
19
  expect(pmd_file.violations.first.description).to eq("The utility class name 'Tools' doesn't match '[A-Z][a-zA-Z0-9]+(Utils?|Helper)'")
20
20
  end
21
21
 
22
- it "should initialize relative path not ending with file separator" do
23
- xml = Oga.parse_xml(File.open("spec/fixtures/pmd_report.xml"))
24
- pmd_file = PmdFile.new("/Users/developer/sample", xml.xpath("//file").first)
22
+ it 'should initialize relative path not ending with file separator' do
23
+ xml = Oga.parse_xml(File.open('spec/fixtures/pmd_report.xml'))
24
+ pmd_file = PmdFile.new('/Users/developer/sample', xml.xpath('//file').first)
25
25
 
26
- expect(pmd_file.absolute_path).to eq("/Users/developer/sample/app/src/main/java/com/android/sample/Tools.java")
27
- expect(pmd_file.relative_path).to eq("app/src/main/java/com/android/sample/Tools.java")
26
+ expect(pmd_file.absolute_path).to eq('/Users/developer/sample/app/src/main/java/com/android/sample/Tools.java')
27
+ expect(pmd_file.relative_path).to eq('app/src/main/java/com/android/sample/Tools.java')
28
28
  expect(pmd_file.violations).not_to be_nil
29
29
  expect(pmd_file.violations.length).to eq(1)
30
30
  expect(pmd_file.violations.first).not_to be_nil
@@ -32,12 +32,12 @@ module Pmd
32
32
  expect(pmd_file.violations.first.description).to eq("The utility class name 'Tools' doesn't match '[A-Z][a-zA-Z0-9]+(Utils?|Helper)'")
33
33
  end
34
34
 
35
- it "should initialize relative path not prefixed" do
36
- xml = Oga.parse_xml(File.open("spec/fixtures/pmd_report.xml"))
37
- pmd_file = PmdFile.new("/Users/developer/something", xml.xpath("//file").first)
35
+ it 'should initialize relative path not prefixed' do
36
+ xml = Oga.parse_xml(File.open('spec/fixtures/pmd_report.xml'))
37
+ pmd_file = PmdFile.new('/Users/developer/something', xml.xpath('//file').first)
38
38
 
39
- expect(pmd_file.absolute_path).to eq("/Users/developer/sample/app/src/main/java/com/android/sample/Tools.java")
40
- expect(pmd_file.relative_path).to eq("/Users/developer/sample/app/src/main/java/com/android/sample/Tools.java")
39
+ expect(pmd_file.absolute_path).to eq('/Users/developer/sample/app/src/main/java/com/android/sample/Tools.java')
40
+ expect(pmd_file.relative_path).to eq('/Users/developer/sample/app/src/main/java/com/android/sample/Tools.java')
41
41
  expect(pmd_file.violations).not_to be_nil
42
42
  expect(pmd_file.violations.length).to eq(1)
43
43
  expect(pmd_file.violations.first).not_to be_nil
data/spec/pmd_spec.rb CHANGED
@@ -1,70 +1,70 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require File.expand_path("spec_helper", __dir__)
3
+ require File.expand_path('spec_helper', __dir__)
4
4
 
5
5
  module Danger
6
6
  describe Danger::DangerPmd do
7
- it "should be a plugin" do
7
+ it 'should be a plugin' do
8
8
  expect(Danger::DangerPmd.new(nil)).to be_a Danger::Plugin
9
9
  end
10
10
 
11
- describe "with Dangerfile" do
11
+ describe 'with Dangerfile' do
12
12
  before do
13
13
  @dangerfile = testing_dangerfile
14
14
  @pmd = @dangerfile.pmd
15
15
  end
16
16
 
17
- it "Check default Gradle task" do
18
- expect(@pmd.gradle_task).to eq("pmd")
17
+ it 'Check default Gradle task' do
18
+ expect(@pmd.gradle_task).to eq('pmd')
19
19
  end
20
20
 
21
- it "Set custom Gradle task" do
22
- custom_task = "pmdStagingDebug"
21
+ it 'Set custom Gradle task' do
22
+ custom_task = 'pmdStagingDebug'
23
23
  @pmd.gradle_task = custom_task
24
24
  expect(@pmd.gradle_task).to eq(custom_task)
25
25
  end
26
26
 
27
- it "Check default skip Gradle task" do
27
+ it 'Check default skip Gradle task' do
28
28
  expect(@pmd.skip_gradle_task).to eq(false)
29
29
  end
30
30
 
31
- it "Set custom skip Gradle task" do
31
+ it 'Set custom skip Gradle task' do
32
32
  skip_gradle_task = true
33
33
  @pmd.skip_gradle_task = skip_gradle_task
34
34
  expect(@pmd.skip_gradle_task).to eq(skip_gradle_task)
35
35
  end
36
36
 
37
- it "Check default report file path" do
38
- expect(@pmd.report_file).to eq("app/build/reports/pmd/pmd.xml")
37
+ it 'Check default report file path' do
38
+ expect(@pmd.report_file).to eq('app/build/reports/pmd/pmd.xml')
39
39
  end
40
40
 
41
- it "Set custom report file path" do
42
- custom_report_path = "custom-path/pmd_sub_report.xml"
41
+ it 'Set custom report file path' do
42
+ custom_report_path = 'custom-path/pmd_sub_report.xml'
43
43
  @pmd.report_file = custom_report_path
44
44
  expect(@pmd.report_file).to eq(custom_report_path)
45
45
  end
46
46
 
47
- it "Check default report files paths" do
48
- expect(@pmd.report_files).to eq(["app/build/reports/pmd/pmd.xml"])
47
+ it 'Check default report files paths' do
48
+ expect(@pmd.report_files).to eq(['app/build/reports/pmd/pmd.xml'])
49
49
  end
50
50
 
51
- it "Set custom report files paths" do
52
- custom_report_paths = ["custom-path/pmd_report_1.xml", "custom-path/pmd_report_2.xml"]
51
+ it 'Set custom report files paths' do
52
+ custom_report_paths = %w[custom-path/pmd_report_1.xml custom-path/pmd_report_2.xml]
53
53
  @pmd.report_files = custom_report_paths
54
54
  expect(@pmd.report_files).to eq(custom_report_paths)
55
55
  end
56
56
 
57
- it "Check default root path" do
57
+ it 'Check default root path' do
58
58
  expect(@pmd.root_path).to eq(Dir.pwd)
59
59
  end
60
60
 
61
- it "Set custom root path" do
62
- root_path = "/Users/developer/sample/"
61
+ it 'Set custom root path' do
62
+ root_path = '/Users/developer/sample/'
63
63
  @pmd.root_path = root_path
64
64
  expect(@pmd.root_path).to eq(root_path)
65
65
  end
66
66
 
67
- it "Report with report file" do
67
+ it 'Report with report file' do
68
68
  target_files = [
69
69
  "app/src/main/java/com/android/sample/MainActivity.java",
70
70
  "app/src/main/java/com/android/sample/Tools.java",
@@ -73,8 +73,8 @@ module Danger
73
73
  ]
74
74
  allow_any_instance_of(Danger::DangerPmd).to receive(:target_files).and_return(target_files)
75
75
 
76
- @pmd.report_file = "spec/fixtures/pmd_report.xml"
77
- @pmd.root_path = "/Users/developer/sample/"
76
+ @pmd.report_file = 'spec/fixtures/pmd_report.xml'
77
+ @pmd.root_path = '/Users/developer/sample/'
78
78
  @pmd.skip_gradle_task = true
79
79
 
80
80
  pmd_issues = @pmd.report
@@ -83,8 +83,8 @@ module Danger
83
83
 
84
84
  pmd_issue1 = pmd_issues[0]
85
85
  expect(pmd_issue1).not_to be_nil
86
- expect(pmd_issue1.absolute_path).to eq("/Users/developer/sample/app/src/main/java/com/android/sample/Tools.java")
87
- expect(pmd_issue1.relative_path).to eq("app/src/main/java/com/android/sample/Tools.java")
86
+ expect(pmd_issue1.absolute_path).to eq('/Users/developer/sample/app/src/main/java/com/android/sample/Tools.java')
87
+ expect(pmd_issue1.relative_path).to eq('app/src/main/java/com/android/sample/Tools.java')
88
88
  expect(pmd_issue1.violations).not_to be_nil
89
89
  expect(pmd_issue1.violations.length).to eq(1)
90
90
  expect(pmd_issue1.violations.first).not_to be_nil
@@ -93,8 +93,8 @@ module Danger
93
93
 
94
94
  pmd_issue2 = pmd_issues[1]
95
95
  expect(pmd_issue2).not_to be_nil
96
- expect(pmd_issue2.absolute_path).to eq("/Users/developer/sample/app/src/main/java/com/android/sample/MainActivity.java")
97
- expect(pmd_issue2.relative_path).to eq("app/src/main/java/com/android/sample/MainActivity.java")
96
+ expect(pmd_issue2.absolute_path).to eq('/Users/developer/sample/app/src/main/java/com/android/sample/MainActivity.java')
97
+ expect(pmd_issue2.relative_path).to eq('app/src/main/java/com/android/sample/MainActivity.java')
98
98
  expect(pmd_issue2.violations).not_to be_nil
99
99
  expect(pmd_issue2.violations.length).to eq(1)
100
100
  expect(pmd_issue2.violations.first).not_to be_nil
@@ -103,8 +103,8 @@ module Danger
103
103
 
104
104
  pmd_issue3 = pmd_issues[2]
105
105
  expect(pmd_issue3).not_to be_nil
106
- expect(pmd_issue3.absolute_path).to eq("/Users/developer/sample/app/src/test/java/com/android/sample/ExampleUnitTest.java")
107
- expect(pmd_issue3.relative_path).to eq("app/src/test/java/com/android/sample/ExampleUnitTest.java")
106
+ expect(pmd_issue3.absolute_path).to eq('/Users/developer/sample/app/src/test/java/com/android/sample/ExampleUnitTest.java')
107
+ expect(pmd_issue3.relative_path).to eq('app/src/test/java/com/android/sample/ExampleUnitTest.java')
108
108
  expect(pmd_issue3.violations).not_to be_nil
109
109
  expect(pmd_issue3.violations.length).to eq(1)
110
110
  expect(pmd_issue3.violations.first).not_to be_nil
@@ -113,8 +113,8 @@ module Danger
113
113
 
114
114
  pmd_issue4 = pmd_issues[3]
115
115
  expect(pmd_issue4).not_to be_nil
116
- expect(pmd_issue4.absolute_path).to eq("/Users/developer/sample/app/src/test/java/com/android/sample/ToolsTest.java")
117
- expect(pmd_issue4.relative_path).to eq("app/src/test/java/com/android/sample/ToolsTest.java")
116
+ expect(pmd_issue4.absolute_path).to eq('/Users/developer/sample/app/src/test/java/com/android/sample/ToolsTest.java')
117
+ expect(pmd_issue4.relative_path).to eq('app/src/test/java/com/android/sample/ToolsTest.java')
118
118
  expect(pmd_issue4.violations).not_to be_nil
119
119
  expect(pmd_issue4.violations.length).to eq(2)
120
120
  expect(pmd_issue4.violations[0]).not_to be_nil
@@ -142,8 +142,8 @@ module Danger
142
142
 
143
143
  pmd_issue1 = pmd_issues[0]
144
144
  expect(pmd_issue1).not_to be_nil
145
- expect(pmd_issue1.absolute_path).to eq("/Users/developer/sample/app/src/main/java/com/android/sample/Tools.java")
146
- expect(pmd_issue1.relative_path).to eq("app/src/main/java/com/android/sample/Tools.java")
145
+ expect(pmd_issue1.absolute_path).to eq('/Users/developer/sample/app/src/main/java/com/android/sample/Tools.java')
146
+ expect(pmd_issue1.relative_path).to eq('app/src/main/java/com/android/sample/Tools.java')
147
147
  expect(pmd_issue1.violations).not_to be_nil
148
148
  expect(pmd_issue1.violations.length).to eq(1)
149
149
  expect(pmd_issue1.violations.first).not_to be_nil
@@ -152,8 +152,8 @@ module Danger
152
152
 
153
153
  pmd_issue2 = pmd_issues[1]
154
154
  expect(pmd_issue2).not_to be_nil
155
- expect(pmd_issue2.absolute_path).to eq("/Users/developer/sample/app/src/test/java/com/android/sample/ToolsTest.java")
156
- expect(pmd_issue2.relative_path).to eq("app/src/test/java/com/android/sample/ToolsTest.java")
155
+ expect(pmd_issue2.absolute_path).to eq('/Users/developer/sample/app/src/test/java/com/android/sample/ToolsTest.java')
156
+ expect(pmd_issue2.relative_path).to eq('app/src/test/java/com/android/sample/ToolsTest.java')
157
157
  expect(pmd_issue2.violations).not_to be_nil
158
158
  expect(pmd_issue2.violations.length).to eq(2)
159
159
  expect(pmd_issue2.violations[0]).not_to be_nil
@@ -175,8 +175,8 @@ module Danger
175
175
  ]
176
176
  allow_any_instance_of(Danger::DangerPmd).to receive(:target_files).and_return(target_files)
177
177
 
178
- @pmd.report_files = ["spec/fixtures/pmd_report.xml", "spec/fixtures/**/pmd_sub_report.xml"]
179
- @pmd.root_path = "/Users/developer/sample/"
178
+ @pmd.report_files = %w[spec/fixtures/pmd_report.xml spec/fixtures/**/pmd_sub_report.xml]
179
+ @pmd.root_path = '/Users/developer/sample/'
180
180
  @pmd.skip_gradle_task = true
181
181
 
182
182
  pmd_issues = @pmd.report
@@ -185,8 +185,8 @@ module Danger
185
185
 
186
186
  pmd_issue1 = pmd_issues[0]
187
187
  expect(pmd_issue1).not_to be_nil
188
- expect(pmd_issue1.absolute_path).to eq("/Users/developer/sample/app/src/main/java/com/android/sample/Tools.java")
189
- expect(pmd_issue1.relative_path).to eq("app/src/main/java/com/android/sample/Tools.java")
188
+ expect(pmd_issue1.absolute_path).to eq('/Users/developer/sample/app/src/main/java/com/android/sample/Tools.java')
189
+ expect(pmd_issue1.relative_path).to eq('app/src/main/java/com/android/sample/Tools.java')
190
190
  expect(pmd_issue1.violations).not_to be_nil
191
191
  expect(pmd_issue1.violations.length).to eq(1)
192
192
  expect(pmd_issue1.violations.first).not_to be_nil
@@ -195,8 +195,8 @@ module Danger
195
195
 
196
196
  pmd_issue2 = pmd_issues[1]
197
197
  expect(pmd_issue2).not_to be_nil
198
- expect(pmd_issue2.absolute_path).to eq("/Users/developer/sample/app/src/main/java/com/android/sample/MainActivity.java")
199
- expect(pmd_issue2.relative_path).to eq("app/src/main/java/com/android/sample/MainActivity.java")
198
+ expect(pmd_issue2.absolute_path).to eq('/Users/developer/sample/app/src/main/java/com/android/sample/MainActivity.java')
199
+ expect(pmd_issue2.relative_path).to eq('app/src/main/java/com/android/sample/MainActivity.java')
200
200
  expect(pmd_issue2.violations).not_to be_nil
201
201
  expect(pmd_issue2.violations.length).to eq(1)
202
202
  expect(pmd_issue2.violations.first).not_to be_nil
@@ -205,8 +205,8 @@ module Danger
205
205
 
206
206
  pmd_issue3 = pmd_issues[2]
207
207
  expect(pmd_issue3).not_to be_nil
208
- expect(pmd_issue3.absolute_path).to eq("/Users/developer/sample/app/src/test/java/com/android/sample/ExampleUnitTest.java")
209
- expect(pmd_issue3.relative_path).to eq("app/src/test/java/com/android/sample/ExampleUnitTest.java")
208
+ expect(pmd_issue3.absolute_path).to eq('/Users/developer/sample/app/src/test/java/com/android/sample/ExampleUnitTest.java')
209
+ expect(pmd_issue3.relative_path).to eq('app/src/test/java/com/android/sample/ExampleUnitTest.java')
210
210
  expect(pmd_issue3.violations).not_to be_nil
211
211
  expect(pmd_issue3.violations.length).to eq(1)
212
212
  expect(pmd_issue3.violations.first).not_to be_nil
@@ -215,8 +215,8 @@ module Danger
215
215
 
216
216
  pmd_issue4 = pmd_issues[3]
217
217
  expect(pmd_issue4).not_to be_nil
218
- expect(pmd_issue4.absolute_path).to eq("/Users/developer/sample/app/src/test/java/com/android/sample/ToolsTest.java")
219
- expect(pmd_issue4.relative_path).to eq("app/src/test/java/com/android/sample/ToolsTest.java")
218
+ expect(pmd_issue4.absolute_path).to eq('/Users/developer/sample/app/src/test/java/com/android/sample/ToolsTest.java')
219
+ expect(pmd_issue4.relative_path).to eq('app/src/test/java/com/android/sample/ToolsTest.java')
220
220
  expect(pmd_issue4.violations).not_to be_nil
221
221
  expect(pmd_issue4.violations.length).to eq(2)
222
222
  expect(pmd_issue4.violations[0]).not_to be_nil
@@ -228,50 +228,44 @@ module Danger
228
228
 
229
229
  pmd_issue5 = pmd_issues[4]
230
230
  expect(pmd_issue5).not_to be_nil
231
- expect(pmd_issue5.absolute_path).to eq("/Users/developer/sample/app/src/main/java/com/android/sample/Utils.java")
232
- expect(pmd_issue5.relative_path).to eq("app/src/main/java/com/android/sample/Utils.java")
231
+ expect(pmd_issue5.absolute_path).to eq('/Users/developer/sample/app/src/main/java/com/android/sample/Utils.java')
232
+ expect(pmd_issue5.relative_path).to eq('app/src/main/java/com/android/sample/Utils.java')
233
233
  expect(pmd_issue5.violations).not_to be_nil
234
234
  expect(pmd_issue5.violations.length).to eq(2)
235
235
  expect(pmd_issue5.violations[0]).not_to be_nil
236
236
  expect(pmd_issue5.violations[0].line).to eq(23)
237
- expect(pmd_issue5.violations[0].description).to eq("These nested if statements could be combined")
237
+ expect(pmd_issue5.violations[0].description).to eq('These nested if statements could be combined')
238
238
  expect(pmd_issue5.violations[1]).not_to be_nil
239
239
  expect(pmd_issue5.violations[1].line).to eq(45)
240
- expect(pmd_issue5.violations[1].description).to eq("The String literal \"unused\" appears 4 times in this file; the first occurrence is on line 45")
240
+ expect(pmd_issue5.violations[1].description).to eq('The String literal "unused" appears 4 times in this file; the first occurrence is on line 45')
241
241
 
242
242
  pmd_issue6 = pmd_issues[5]
243
243
  expect(pmd_issue6).not_to be_nil
244
- expect(pmd_issue6.absolute_path).to eq("/Users/developer/sample/app/src/main/java/com/android/sample/Application.java")
245
- expect(pmd_issue6.relative_path).to eq("app/src/main/java/com/android/sample/Application.java")
244
+ expect(pmd_issue6.absolute_path).to eq('/Users/developer/sample/app/src/main/java/com/android/sample/Application.java')
245
+ expect(pmd_issue6.relative_path).to eq('app/src/main/java/com/android/sample/Application.java')
246
246
  expect(pmd_issue6.violations).not_to be_nil
247
247
  expect(pmd_issue6.violations.length).to eq(1)
248
248
  expect(pmd_issue6.violations[0]).not_to be_nil
249
249
  expect(pmd_issue6.violations[0].line).to eq(135)
250
- expect(pmd_issue6.violations[0].description).to eq("The String literal \"label\" appears 5 times in this file; the first occurrence is on line 135")
250
+ expect(pmd_issue6.violations[0].description).to eq('The String literal "label" appears 5 times in this file; the first occurrence is on line 135')
251
251
  end
252
252
 
253
- it "Report without Gradle" do
253
+ it 'Report without Gradle' do
254
254
  allow_any_instance_of(Danger::DangerPmd).to receive(:target_files).and_return([])
255
255
 
256
- @pmd.report_file = "spec/fixtures/pmd_report.xml"
256
+ @pmd.report_file = 'spec/fixtures/pmd_report.xml'
257
257
  @pmd.skip_gradle_task = false
258
258
 
259
- pmd_issues = @pmd.report
260
- expect(pmd_issues).not_to be_nil
261
- expect(pmd_issues.length).to be(1)
262
- expect(pmd_issues[0]).to be("Could not find `gradlew` inside current directory")
259
+ expect { @pmd.report }.to raise_error('Could not find `gradlew` inside current directory')
263
260
  end
264
261
 
265
- it "Report without existing report file" do
262
+ it 'Report without existing report file' do
266
263
  allow_any_instance_of(Danger::DangerPmd).to receive(:target_files).and_return([])
267
264
 
268
- @pmd.report_file = "spec/fixtures/custom/pmd_report.xml"
265
+ @pmd.report_file = 'spec/fixtures/custom/pmd_report.xml'
269
266
  @pmd.skip_gradle_task = true
270
267
 
271
- pmd_issues = @pmd.report
272
- expect(pmd_issues).not_to be_nil
273
- expect(pmd_issues.length).to be(1)
274
- expect(pmd_issues[0]).to eq("Could not find matching PMD report files for [\"spec/fixtures/custom/pmd_report.xml\"] inside current directory")
268
+ expect { @pmd.report }.to raise_error('Could not find matching PMD report files for ["spec/fixtures/custom/pmd_report.xml"] inside current directory')
275
269
  end
276
270
  end
277
271
  end
data/spec/spec_helper.rb CHANGED
@@ -1,30 +1,30 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "pathname"
4
- ROOT = Pathname.new(File.expand_path("..", __dir__))
5
- $:.unshift((ROOT + "lib").to_s)
6
- $:.unshift((ROOT + "spec").to_s)
3
+ require 'pathname'
4
+ ROOT = Pathname.new(File.expand_path('..', __dir__))
5
+ $LOAD_PATH.unshift("#{ROOT}lib".to_s)
6
+ $LOAD_PATH.unshift("#{ROOT}spec".to_s)
7
7
 
8
- require "bundler/setup"
9
- require "pry"
8
+ require 'bundler/setup'
9
+ require 'pry'
10
10
 
11
- require "rspec"
12
- require "danger"
11
+ require 'rspec'
12
+ require 'danger'
13
13
 
14
- if `git remote -v` == ""
15
- puts "You cannot run tests without setting a local git remote on this repo"
14
+ if `git remote -v` == ''
15
+ puts 'You cannot run tests without setting a local git remote on this repo'
16
16
  puts "It's a weird side-effect of Danger's internals."
17
17
  exit(0)
18
18
  end
19
19
 
20
20
  # Use coloured output, it's the best.
21
21
  RSpec.configure do |config|
22
- config.filter_gems_from_backtrace "bundler"
22
+ config.filter_gems_from_backtrace 'bundler'
23
23
  config.color = true
24
24
  config.tty = true
25
25
  end
26
26
 
27
- require "danger_plugin"
27
+ require 'danger_plugin'
28
28
 
29
29
  # These functions are a subset of https://github.com/danger/danger/blob/master/spec/spec_helper.rb
30
30
  # If you are expanding these files, see if it's already been done ^.
@@ -42,7 +42,7 @@ def testing_ui
42
42
 
43
43
  cork = Cork::Board.new(out: @output)
44
44
  def cork.string
45
- out.string.gsub(/\e\[([;\d]+)?m/, "")
45
+ out.string.gsub(/\e\[([;\d]+)?m/, '')
46
46
  end
47
47
  cork
48
48
  end
@@ -52,11 +52,11 @@ end
52
52
  # running a PR on TravisCI
53
53
  def testing_env
54
54
  {
55
- "HAS_JOSH_K_SEAL_OF_APPROVAL" => "true",
56
- "TRAVIS_PULL_REQUEST" => "800",
57
- "TRAVIS_REPO_SLUG" => "artsy/eigen",
58
- "TRAVIS_COMMIT_RANGE" => "759adcbd0d8f...13c4dc8bb61d",
59
- "DANGER_GITHUB_API_TOKEN" => "123sbdq54erfsd3422gdfio"
55
+ 'HAS_JOSH_K_SEAL_OF_APPROVAL' => 'true',
56
+ 'TRAVIS_PULL_REQUEST' => '800',
57
+ 'TRAVIS_REPO_SLUG' => 'artsy/eigen',
58
+ 'TRAVIS_COMMIT_RANGE' => '759adcbd0d8f...13c4dc8bb61d',
59
+ 'DANGER_GITHUB_API_TOKEN' => '123sbdq54erfsd3422gdfio'
60
60
  }
61
61
  end
62
62
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger-pmd
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mathieu Rul
@@ -30,28 +30,28 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '2.10'
33
+ version: '2.15'
34
34
  type: :runtime
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: '2.10'
40
+ version: '2.15'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.3'
47
+ version: '2.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.3'
54
+ version: '2.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -72,98 +72,126 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '3.4'
75
+ version: 3.10.0
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '3.4'
82
+ version: 3.10.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rubocop
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0.75'
89
+ version: 1.11.0
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0.75'
96
+ version: 1.11.0
97
+ - !ruby/object:Gem::Dependency
98
+ name: rubocop-rake
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 0.5.1
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 0.5.1
111
+ - !ruby/object:Gem::Dependency
112
+ name: rubocop-rspec
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: 2.2.0
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: 2.2.0
97
125
  - !ruby/object:Gem::Dependency
98
126
  name: yard
99
127
  requirement: !ruby/object:Gem::Requirement
100
128
  requirements:
101
129
  - - "~>"
102
130
  - !ruby/object:Gem::Version
103
- version: 0.9.20
131
+ version: 0.9.26
104
132
  type: :development
105
133
  prerelease: false
106
134
  version_requirements: !ruby/object:Gem::Requirement
107
135
  requirements:
108
136
  - - "~>"
109
137
  - !ruby/object:Gem::Version
110
- version: 0.9.20
138
+ version: 0.9.26
111
139
  - !ruby/object:Gem::Dependency
112
140
  name: guard
113
141
  requirement: !ruby/object:Gem::Requirement
114
142
  requirements:
115
143
  - - "~>"
116
144
  - !ruby/object:Gem::Version
117
- version: '2.14'
145
+ version: 2.16.2
118
146
  type: :development
119
147
  prerelease: false
120
148
  version_requirements: !ruby/object:Gem::Requirement
121
149
  requirements:
122
150
  - - "~>"
123
151
  - !ruby/object:Gem::Version
124
- version: '2.14'
152
+ version: 2.16.2
125
153
  - !ruby/object:Gem::Dependency
126
154
  name: guard-rspec
127
155
  requirement: !ruby/object:Gem::Requirement
128
156
  requirements:
129
157
  - - "~>"
130
158
  - !ruby/object:Gem::Version
131
- version: '4.7'
159
+ version: 4.7.3
132
160
  type: :development
133
161
  prerelease: false
134
162
  version_requirements: !ruby/object:Gem::Requirement
135
163
  requirements:
136
164
  - - "~>"
137
165
  - !ruby/object:Gem::Version
138
- version: '4.7'
166
+ version: 4.7.3
139
167
  - !ruby/object:Gem::Dependency
140
168
  name: listen
141
169
  requirement: !ruby/object:Gem::Requirement
142
170
  requirements:
143
- - - '='
171
+ - - "~>"
144
172
  - !ruby/object:Gem::Version
145
- version: 3.0.7
173
+ version: 3.0.8
146
174
  type: :development
147
175
  prerelease: false
148
176
  version_requirements: !ruby/object:Gem::Requirement
149
177
  requirements:
150
- - - '='
178
+ - - "~>"
151
179
  - !ruby/object:Gem::Version
152
- version: 3.0.7
180
+ version: 3.0.8
153
181
  - !ruby/object:Gem::Dependency
154
182
  name: pry
155
183
  requirement: !ruby/object:Gem::Requirement
156
184
  requirements:
157
- - - ">="
185
+ - - "~>"
158
186
  - !ruby/object:Gem::Version
159
- version: '0'
187
+ version: 0.14.0
160
188
  type: :development
161
189
  prerelease: false
162
190
  version_requirements: !ruby/object:Gem::Requirement
163
191
  requirements:
164
- - - ">="
192
+ - - "~>"
165
193
  - !ruby/object:Gem::Version
166
- version: '0'
194
+ version: 0.14.0
167
195
  description: A Danger plugin for PMD.
168
196
  email:
169
197
  - mathroule@gmail.com
@@ -213,7 +241,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
213
241
  - !ruby/object:Gem::Version
214
242
  version: '0'
215
243
  requirements: []
216
- rubygems_version: 3.0.3
244
+ rubygems_version: 3.2.3
217
245
  signing_key:
218
246
  specification_version: 4
219
247
  summary: A Danger plugin for PMD (Programming Mistake Detector), see https://pmd.github.io.