danger-pmd 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/pmd/gem_version.rb +1 -1
- data/lib/pmd/plugin.rb +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a2d9f880fd61118eab5f466d22fa9a63d90e642cf3f3bec0f1afeb3365a7c84
|
4
|
+
data.tar.gz: '0840aa8e767568221ffe52c5e8842900dce15cc8828255d0fa567752bb6d5c30'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8986e2a6b8dfb31b5725e63477022c14d72aecfe9d28ed3754a08ad3d747b575e7263b1367fa8b0ed95f38cf5030f0bccfd268c56737180db2996e40ec1e6d43
|
7
|
+
data.tar.gz: ba13a09f7402bcabdce873fae2047d81ee49fdfae3bba44d3c954bddfe2f5cc6115453eda265cf5969f1bb9a8a8fb79ef0ba5878be357a920c17e23d1e19fe90
|
data/Gemfile.lock
CHANGED
data/lib/pmd/gem_version.rb
CHANGED
data/lib/pmd/plugin.rb
CHANGED
@@ -101,7 +101,7 @@ module Danger
|
|
101
101
|
# It fails if `report_file` cannot be found inside current directory.
|
102
102
|
# It fails if `report_files` is empty.
|
103
103
|
# @return [Array[PmdFile]]
|
104
|
-
def report(
|
104
|
+
def report(inline_mode = true)
|
105
105
|
unless skip_gradle_task
|
106
106
|
return fail("Could not find `gradlew` inside current directory") unless gradlew_exists?
|
107
107
|
|
@@ -111,7 +111,7 @@ module Danger
|
|
111
111
|
report_files_expanded = Dir.glob(report_files).sort
|
112
112
|
return fail("Could not find matching PMD report files for #{report_files} inside current directory") if report_files_expanded.empty?
|
113
113
|
|
114
|
-
do_comment(report_files_expanded,
|
114
|
+
do_comment(report_files_expanded, inline_mode)
|
115
115
|
end
|
116
116
|
|
117
117
|
private
|
@@ -157,7 +157,7 @@ module Danger
|
|
157
157
|
|
158
158
|
# Generate report and send inline comment with Danger's warn or fail method.
|
159
159
|
# @return [Array[PmdFile]]
|
160
|
-
def do_comment(report_files,
|
160
|
+
def do_comment(report_files, inline_mode = true)
|
161
161
|
pmd_issues = []
|
162
162
|
|
163
163
|
report_files.each do |report_file|
|
@@ -167,7 +167,7 @@ module Danger
|
|
167
167
|
pmd_issues.push(pmd_file)
|
168
168
|
|
169
169
|
pmd_file.violations.each do |pmd_violation|
|
170
|
-
if
|
170
|
+
if inline_mode
|
171
171
|
send(pmd_violation.type, pmd_violation.description, file: pmd_file.relative_path, line: pmd_violation.line)
|
172
172
|
else
|
173
173
|
send(pmd_violation.type, "#{pmd_file.relative_path} : #{pmd_violation.description} at #{pmd_violation.line}")
|