danger-warnings_next_generation 0.1.5 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +31 -0
- data/danger-warnings_next_generation.gemspec +1 -1
- data/lib/warnings_next_generation/gem_version.rb +1 -1
- data/lib/warnings_next_generation/plugin.rb +74 -15
- data/spec/assets/aggregation_two.json +17 -0
- data/spec/warnings_next_generation_spec.rb +255 -23
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d83fdf1131f573ea07ccd0c01d37e2a7c95f8519b4c890425251c821d0e5536
|
4
|
+
data.tar.gz: f4ecd4575df5bd28ba7fc11d85e36463ed57a05dbed5c030d90011de72dc1ec7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c02b8bbd0b54a1881e3a71e53756217f3eeff02407136c5e75f716d9ccb10011fb7f9ebd678537425c5726c248ff7fd390f0298ff808b0b09cb32a4f52b4d70
|
7
|
+
data.tar.gz: 9dd75d23bfd076882e38fab6d8e816f6acc2a018a243894f18bf944d7594b934e672e1c9412c092f1ca5000ab23f28e3c561e74f5caaafaa78d562cf1a974357
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## [1.0.0] - 2019-6-28
|
8
|
+
### Added
|
9
|
+
- Option `inline_threshold`
|
10
|
+
- Option `table_threshold`
|
11
|
+
|
7
12
|
## [0.1.5] - 2019-6-02
|
8
13
|
### Changed
|
9
14
|
- Add tool name to inline comment
|
data/README.md
CHANGED
@@ -185,3 +185,34 @@ warnings_next_generation.overview_report(
|
|
185
185
|
)
|
186
186
|
</pre>
|
187
187
|
</blockquote>
|
188
|
+
|
189
|
+
## Comments threshold
|
190
|
+
|
191
|
+
You can switch from inline comments to table comment if all issues >= threshold or to warnings if >= table threshold
|
192
|
+
|
193
|
+
<blockquote>Switch to table comment if combined issues size >= 15
|
194
|
+
<pre>
|
195
|
+
warnings_next_generation.report(
|
196
|
+
inline: true
|
197
|
+
inline_threshold: 15
|
198
|
+
)
|
199
|
+
</pre>
|
200
|
+
</blockquote>
|
201
|
+
|
202
|
+
<blockquote>Switch to table comment if combined issues size >= 200
|
203
|
+
<pre>
|
204
|
+
warnings_next_generation.report(
|
205
|
+
table_threshold: 200
|
206
|
+
)
|
207
|
+
</pre>
|
208
|
+
</blockquote>
|
209
|
+
|
210
|
+
<blockquote>Switch from inline comment to table, and automatically to warning.
|
211
|
+
<pre>
|
212
|
+
warnings_next_generation.report(
|
213
|
+
inline: true
|
214
|
+
inline_threshold: 20
|
215
|
+
table_threshold: 200
|
216
|
+
)
|
217
|
+
</pre>
|
218
|
+
</blockquote>
|
@@ -8,7 +8,7 @@ require "warnings_next_generation/gem_version.rb"
|
|
8
8
|
Gem::Specification.new do |spec|
|
9
9
|
spec.name = "danger-warnings_next_generation"
|
10
10
|
spec.version = WarningsNextGeneration::VERSION
|
11
|
-
spec.authors = ["
|
11
|
+
spec.authors = ["Kyaak"]
|
12
12
|
spec.email = ["kyaak.dev@gmail.com"]
|
13
13
|
spec.description = "Danger plugin to for Jenkins-Warnings-Next-Generation plugin."
|
14
14
|
spec.summary = "Read Jenkins warnings-ng reports and comment pull request with found issues."
|
@@ -89,9 +89,66 @@ module Danger
|
|
89
89
|
def tools_report(*args)
|
90
90
|
options = args.first
|
91
91
|
check_auth(options)
|
92
|
+
|
93
|
+
collected_details = collect_details(options)
|
94
|
+
force_table = should_force_table(options, collected_details, baseline(options))
|
95
|
+
force_warning = should_force_warning(options, collected_details)
|
96
|
+
|
97
|
+
collected_details.each do |details|
|
98
|
+
name = details[:name]
|
99
|
+
detail_item = details[:details]
|
100
|
+
|
101
|
+
if inline?(options) && check_baseline(options) && !force_table
|
102
|
+
inline_report(name, detail_item, baseline(options))
|
103
|
+
else
|
104
|
+
tool_table(name, detail_item, force_warning)
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
private
|
110
|
+
|
111
|
+
def should_force_table(options, collected_details, baseline)
|
112
|
+
result = false
|
113
|
+
threshold = options[:inline_threshold] if options
|
114
|
+
if threshold
|
115
|
+
sum = 0
|
116
|
+
collected_details.each do |details|
|
117
|
+
issues = details[:details]["issues"]
|
118
|
+
issues ||= details[:details][:issues]
|
119
|
+
issues.each do |issue|
|
120
|
+
file = issue["fileName"].gsub(baseline, "")
|
121
|
+
sum += 1 if file_in_changeset?(file)
|
122
|
+
end
|
123
|
+
end
|
124
|
+
result = true if sum >= threshold
|
125
|
+
end
|
126
|
+
result
|
127
|
+
end
|
128
|
+
|
129
|
+
def should_force_warning(options, collected_details)
|
130
|
+
result = false
|
131
|
+
threshold = options[:table_threshold] if options
|
132
|
+
if threshold
|
133
|
+
sum = 0
|
134
|
+
collected_details.each do |details|
|
135
|
+
issues = details[:details]["issues"]
|
136
|
+
issues ||= details[:details][:issues]
|
137
|
+
issues.each do |issue|
|
138
|
+
file = File.basename(issue["fileName"])
|
139
|
+
sum += 1 if basename_in_changeset?(file)
|
140
|
+
end
|
141
|
+
end
|
142
|
+
result = true if sum >= threshold
|
143
|
+
end
|
144
|
+
result
|
145
|
+
end
|
146
|
+
|
147
|
+
def collect_details(options)
|
92
148
|
tool_ids = include(options)
|
93
149
|
|
94
150
|
tools = tool_entries
|
151
|
+
result = []
|
95
152
|
tools.each do |tool|
|
96
153
|
name = tool["name"]
|
97
154
|
url = tool["latestUrl"]
|
@@ -99,16 +156,15 @@ module Danger
|
|
99
156
|
|
100
157
|
next if use_include_option?(options) && !tool_ids.include?(id)
|
101
158
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
159
|
+
details = details_result(url)
|
160
|
+
result << {
|
161
|
+
name: name,
|
162
|
+
details: details,
|
163
|
+
}
|
107
164
|
end
|
165
|
+
result
|
108
166
|
end
|
109
167
|
|
110
|
-
private
|
111
|
-
|
112
168
|
def include(options)
|
113
169
|
options && !options[:include].nil? ? options[:include] : []
|
114
170
|
end
|
@@ -155,9 +211,9 @@ module Danger
|
|
155
211
|
!options.nil? && !options[:include].nil?
|
156
212
|
end
|
157
213
|
|
158
|
-
def tool_table(name,
|
159
|
-
details = details_result(url)
|
214
|
+
def tool_table(name, details, force_warnings)
|
160
215
|
issues = details["issues"]
|
216
|
+
issues ||= details[:issues]
|
161
217
|
|
162
218
|
table = WarningsNextGeneration::MarkdownTable.new
|
163
219
|
table.detail_header(TABLE_HEADER_SEVERITY, TABLE_HEADER_FILE, TABLE_HEADER_DESCRIPTION)
|
@@ -172,15 +228,18 @@ module Danger
|
|
172
228
|
table.line(severity, "#{file}:#{line}", "#{category_type(issue)} #{message}")
|
173
229
|
end
|
174
230
|
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
231
|
+
if force_warnings
|
232
|
+
warn("This changeset has #{table.size} **#{name}** issues.")
|
233
|
+
else
|
234
|
+
unless table.size.zero?
|
235
|
+
content = +"### #{name}\n\n"
|
236
|
+
content << table.to_markdown
|
237
|
+
markdown(content)
|
238
|
+
end
|
179
239
|
end
|
180
240
|
end
|
181
241
|
|
182
|
-
def inline_report(name,
|
183
|
-
details = details_result(url)
|
242
|
+
def inline_report(name, details, baseline)
|
184
243
|
issues = details["issues"]
|
185
244
|
|
186
245
|
issues.each do |issue|
|
@@ -0,0 +1,17 @@
|
|
1
|
+
{
|
2
|
+
"_class": "io.jenkins.plugins.analysis.core.restapi.AggregationApi",
|
3
|
+
"tools": [
|
4
|
+
{
|
5
|
+
"id": "java",
|
6
|
+
"latestUrl": "http://localhost:8080/view/White%20Mountains/job/New%20-%20Pipeline%20-%20Simple%20Model/26/java",
|
7
|
+
"name": "Java Warnings",
|
8
|
+
"threshold": 1
|
9
|
+
},
|
10
|
+
{
|
11
|
+
"id": "pmd",
|
12
|
+
"latestUrl": "http://localhost:8080/view/White%20Mountains/job/New%20-%20Pipeline%20-%20Simple%20Model/26/pmd",
|
13
|
+
"name": "Pmd Warnings",
|
14
|
+
"threshold": 1
|
15
|
+
}
|
16
|
+
]
|
17
|
+
}
|
@@ -378,6 +378,226 @@ module Danger
|
|
378
378
|
markdowns = @dangerfile.status_report[:markdowns]
|
379
379
|
expect(markdowns.length).to be(0)
|
380
380
|
end
|
381
|
+
|
382
|
+
it "creates inline comments if issues lower than threshold" do
|
383
|
+
aggregation_return("/assets/aggregation_single.json")
|
384
|
+
issues = android_lint_issues(14)
|
385
|
+
expect(issues["issues"].size).to be(14)
|
386
|
+
details_return_issue(issues)
|
387
|
+
mock_file_in_changeset(true)
|
388
|
+
@my_plugin.tools_report(inline: true, baseline: "mylibrary/src/main", inline_threshold: 15)
|
389
|
+
|
390
|
+
markdowns = @dangerfile.status_report[:markdowns]
|
391
|
+
messages = @dangerfile.status_report[:messages]
|
392
|
+
expect(markdowns.length).to be(0)
|
393
|
+
expect(messages.length).to be(14)
|
394
|
+
end
|
395
|
+
|
396
|
+
it "creates inline comments if issues not in changedfiles and lower than threshold" do
|
397
|
+
aggregation_return("/assets/aggregation_two.json")
|
398
|
+
java_issues = android_lint_issues(8)
|
399
|
+
pmd_issues = android_lint_issues(8, "OtherFile.java")
|
400
|
+
details_return_issue(java_issues, "java")
|
401
|
+
details_return_issue(pmd_issues, "pmd")
|
402
|
+
target_files_return(["src/main/AndroidManifest.xml"])
|
403
|
+
@my_plugin.tools_report(inline: true, baseline: "project", inline_threshold: 15)
|
404
|
+
|
405
|
+
markdowns = @dangerfile.status_report[:markdowns]
|
406
|
+
messages = @dangerfile.status_report[:messages]
|
407
|
+
expect(markdowns.length).to be(0)
|
408
|
+
expect(messages.length).to be(8)
|
409
|
+
end
|
410
|
+
|
411
|
+
it "creates table comments if issues not in changedfiles and lower than table threshold" do
|
412
|
+
aggregation_return("/assets/aggregation_two.json")
|
413
|
+
java_issues = android_lint_issues(8)
|
414
|
+
pmd_issues_1 = android_lint_issues(8, "OtherFile.java")
|
415
|
+
pmd_issues_2 = android_lint_issues(8, "OtherFileB.java")
|
416
|
+
pmd_issues = { "issues": pmd_issues_1["issues"] += pmd_issues_2["issues"] }
|
417
|
+
details_return_issue(java_issues, "java")
|
418
|
+
details_return_issue(pmd_issues, "pmd")
|
419
|
+
target_files_return(["src/main/AndroidManifest.xml", "src/main/OtherFile.java"])
|
420
|
+
@my_plugin.tools_report(inline: true, baseline: "project", inline_threshold: 15, table_threshold: 30)
|
421
|
+
|
422
|
+
markdowns = @dangerfile.status_report[:markdowns]
|
423
|
+
messages = @dangerfile.status_report[:messages]
|
424
|
+
expect(markdowns.length).to be(2)
|
425
|
+
expect(messages.length).to be(0)
|
426
|
+
end
|
427
|
+
|
428
|
+
it "creates table comment if issues equal than threshold" do
|
429
|
+
aggregation_return("/assets/aggregation_single.json")
|
430
|
+
issues = android_lint_issues(15)
|
431
|
+
expect(issues["issues"].size).to be(15)
|
432
|
+
details_return_issue(issues)
|
433
|
+
mock_file_in_changeset(true)
|
434
|
+
mock_basename_in_changeset(true)
|
435
|
+
@my_plugin.tools_report(inline: true, baseline: "mylibrary/src/main", inline_threshold: 15)
|
436
|
+
|
437
|
+
markdowns = @dangerfile.status_report[:markdowns]
|
438
|
+
messages = @dangerfile.status_report[:messages]
|
439
|
+
expect(markdowns.length).to be(1)
|
440
|
+
expect(messages.length).to be(0)
|
441
|
+
end
|
442
|
+
|
443
|
+
it "creates table comment if issues greater than threshold" do
|
444
|
+
aggregation_return("/assets/aggregation_single.json")
|
445
|
+
issues = android_lint_issues(16)
|
446
|
+
expect(issues["issues"].size).to be(16)
|
447
|
+
details_return_issue(issues)
|
448
|
+
mock_file_in_changeset(true)
|
449
|
+
mock_basename_in_changeset(true)
|
450
|
+
@my_plugin.tools_report(inline: true, baseline: "mylibrary/src/main", inline_threshold: 15)
|
451
|
+
|
452
|
+
markdowns = @dangerfile.status_report[:markdowns]
|
453
|
+
messages = @dangerfile.status_report[:messages]
|
454
|
+
expect(markdowns.length).to be(1)
|
455
|
+
expect(messages.length).to be(0)
|
456
|
+
end
|
457
|
+
|
458
|
+
it "creates table comment if issues of multiple reports greater than threshold" do
|
459
|
+
aggregation_return("/assets/aggregation.json")
|
460
|
+
issues = android_lint_issues(9)
|
461
|
+
expect(issues["issues"].size).to be(9)
|
462
|
+
details_return_issue(issues, "java")
|
463
|
+
details_return_issue(issues, "checkstyle")
|
464
|
+
details_return_issue(issues, "pmd")
|
465
|
+
details_return_issue(issues, "maven")
|
466
|
+
details_return_issue(issues, "javadoc")
|
467
|
+
details_return_issue(issues, "spotbugs")
|
468
|
+
details_return_issue(issues, "cpd")
|
469
|
+
details_return_issue(issues, "open-tasks")
|
470
|
+
mock_file_in_changeset(true)
|
471
|
+
mock_basename_in_changeset(true)
|
472
|
+
@my_plugin.tools_report(inline: true, baseline: "mylibrary/src/main", inline_threshold: 15)
|
473
|
+
|
474
|
+
markdowns = @dangerfile.status_report[:markdowns]
|
475
|
+
messages = @dangerfile.status_report[:messages]
|
476
|
+
expect(markdowns.length).to be(8)
|
477
|
+
expect(messages.length).to be(0)
|
478
|
+
end
|
479
|
+
|
480
|
+
it "creates inline comment if issues of multiple reports lower threshold" do
|
481
|
+
aggregation_return("/assets/aggregation.json")
|
482
|
+
issues = android_lint_issues(10)
|
483
|
+
expect(issues["issues"].size).to be(10)
|
484
|
+
details_return_issue(issues, "java")
|
485
|
+
details_return_issue(issues, "checkstyle")
|
486
|
+
details_return_issue(issues, "pmd")
|
487
|
+
details_return_issue(issues, "maven")
|
488
|
+
details_return_issue(issues, "javadoc")
|
489
|
+
details_return_issue(issues, "spotbugs")
|
490
|
+
details_return_issue(issues, "cpd")
|
491
|
+
details_return_issue(issues, "open-tasks")
|
492
|
+
mock_file_in_changeset(true)
|
493
|
+
mock_basename_in_changeset(true)
|
494
|
+
@my_plugin.tools_report(inline: true, baseline: "mylibrary/src/main", inline_threshold: 100)
|
495
|
+
|
496
|
+
markdowns = @dangerfile.status_report[:markdowns]
|
497
|
+
messages = @dangerfile.status_report[:messages]
|
498
|
+
expect(markdowns.length).to be(0)
|
499
|
+
expect(messages.length).to be(80)
|
500
|
+
end
|
501
|
+
|
502
|
+
it "creates inline comments if issues lower than inline_threshold and table_threshold" do
|
503
|
+
aggregation_return("/assets/aggregation_single.json")
|
504
|
+
issues = android_lint_issues(14)
|
505
|
+
expect(issues["issues"].size).to be(14)
|
506
|
+
details_return_issue(issues)
|
507
|
+
mock_file_in_changeset(true)
|
508
|
+
@my_plugin.tools_report(inline: true, baseline: "mylibrary/src/main", inline_threshold: 15, table_threshold: 15)
|
509
|
+
|
510
|
+
markdowns = @dangerfile.status_report[:markdowns]
|
511
|
+
messages = @dangerfile.status_report[:messages]
|
512
|
+
expect(markdowns.length).to be(0)
|
513
|
+
expect(messages.length).to be(14)
|
514
|
+
end
|
515
|
+
|
516
|
+
it "creates table comments if issues higher than inline_threshold and lower table_threshold" do
|
517
|
+
aggregation_return("/assets/aggregation_single.json")
|
518
|
+
issues = android_lint_issues(14)
|
519
|
+
expect(issues["issues"].size).to be(14)
|
520
|
+
details_return_issue(issues)
|
521
|
+
mock_file_in_changeset(true)
|
522
|
+
mock_basename_in_changeset(true)
|
523
|
+
@my_plugin.tools_report(inline: true, baseline: "mylibrary/src/main", inline_threshold: 10, table_threshold: 15)
|
524
|
+
|
525
|
+
markdowns = @dangerfile.status_report[:markdowns]
|
526
|
+
messages = @dangerfile.status_report[:messages]
|
527
|
+
expect(markdowns.length).to be(1)
|
528
|
+
expect(messages.length).to be(0)
|
529
|
+
end
|
530
|
+
|
531
|
+
it "creates warning comment if issues greater than table_threshold" do
|
532
|
+
aggregation_return("/assets/aggregation_single.json")
|
533
|
+
issues = android_lint_issues(16)
|
534
|
+
expect(issues["issues"].size).to be(16)
|
535
|
+
details_return_issue(issues)
|
536
|
+
mock_file_in_changeset(true)
|
537
|
+
mock_basename_in_changeset(true)
|
538
|
+
@my_plugin.tools_report(table_threshold: 15)
|
539
|
+
|
540
|
+
markdowns = @dangerfile.status_report[:markdowns]
|
541
|
+
messages = @dangerfile.status_report[:messages]
|
542
|
+
warnings = @dangerfile.status_report[:warnings]
|
543
|
+
expect(markdowns.length).to be(0)
|
544
|
+
expect(messages.length).to be(0)
|
545
|
+
expect(warnings.length).to be(1)
|
546
|
+
expect(warnings[0]).to include("16 **Java Warnings** issues")
|
547
|
+
end
|
548
|
+
|
549
|
+
it "creates table comment if issues greater than table_threshold but not in changelog" do
|
550
|
+
aggregation_return("/assets/aggregation_two.json")
|
551
|
+
java_issues = android_lint_issues(8)
|
552
|
+
pmd_issues = android_lint_issues(8, "OtherFile.java")
|
553
|
+
details_return_issue(java_issues, "java")
|
554
|
+
details_return_issue(pmd_issues, "pmd")
|
555
|
+
target_files_return(["src/main/AndroidManifest.xml"])
|
556
|
+
@my_plugin.tools_report(table_threshold: 15)
|
557
|
+
|
558
|
+
markdowns = @dangerfile.status_report[:markdowns]
|
559
|
+
messages = @dangerfile.status_report[:messages]
|
560
|
+
expect(markdowns.length).to be(1)
|
561
|
+
expect(messages.length).to be(0)
|
562
|
+
end
|
563
|
+
|
564
|
+
it "creates warn comments if issues in changedfiles and higher than table threshold" do
|
565
|
+
aggregation_return("/assets/aggregation_two.json")
|
566
|
+
java_issues = android_lint_issues(8)
|
567
|
+
pmd_issues_1 = android_lint_issues(8, "OtherFile.java")
|
568
|
+
pmd_issues_2 = android_lint_issues(8, "OtherFileB.java")
|
569
|
+
pmd_issues = { "issues": pmd_issues_1["issues"] += pmd_issues_2["issues"] }
|
570
|
+
details_return_issue(java_issues, "java")
|
571
|
+
details_return_issue(pmd_issues, "pmd")
|
572
|
+
target_files_return(["src/main/AndroidManifest.xml", "src/main/OtherFile.java"])
|
573
|
+
@my_plugin.tools_report(table_threshold: 15)
|
574
|
+
|
575
|
+
markdowns = @dangerfile.status_report[:markdowns]
|
576
|
+
messages = @dangerfile.status_report[:messages]
|
577
|
+
warnings = @dangerfile.status_report[:warnings]
|
578
|
+
expect(markdowns.length).to be(0)
|
579
|
+
expect(messages.length).to be(0)
|
580
|
+
expect(warnings.length).to be(2)
|
581
|
+
expect(warnings[1]).to include("8 **Pmd Warnings** issues")
|
582
|
+
end
|
583
|
+
|
584
|
+
it "creates warning comment if issues greater than inline and table threshold" do
|
585
|
+
aggregation_return("/assets/aggregation_single.json")
|
586
|
+
issues = android_lint_issues(16)
|
587
|
+
expect(issues["issues"].size).to be(16)
|
588
|
+
details_return_issue(issues)
|
589
|
+
mock_file_in_changeset(true)
|
590
|
+
mock_basename_in_changeset(true)
|
591
|
+
@my_plugin.tools_report(inline: true, baseline: "mylibrary/src/main", inline_threshold: 10, table_threshold: 15)
|
592
|
+
|
593
|
+
markdowns = @dangerfile.status_report[:markdowns]
|
594
|
+
messages = @dangerfile.status_report[:messages]
|
595
|
+
warnings = @dangerfile.status_report[:warnings]
|
596
|
+
expect(markdowns.length).to be(0)
|
597
|
+
expect(messages.length).to be(0)
|
598
|
+
expect(warnings.length).to be(1)
|
599
|
+
expect(warnings[0]).to include("16 **Java Warnings** issues")
|
600
|
+
end
|
381
601
|
end
|
382
602
|
end
|
383
603
|
end
|
@@ -401,33 +621,37 @@ def details_return(file)
|
|
401
621
|
@my_plugin.stubs(:details_result).returns(json)
|
402
622
|
end
|
403
623
|
|
404
|
-
def details_return_issue(issue)
|
405
|
-
@my_plugin.stubs(:details_result).returns(issue)
|
624
|
+
def details_return_issue(issue, toold_id = "java")
|
625
|
+
@my_plugin.stubs(:details_result).with("http://localhost:8080/view/White%20Mountains/job/New%20-%20Pipeline%20-%20Simple%20Model/26/#{toold_id}").returns(issue)
|
406
626
|
end
|
407
627
|
|
408
|
-
def android_lint_issues
|
628
|
+
def android_lint_issues(count = 1, filename = "AndroidManifest.xml")
|
409
629
|
json = {
|
410
|
-
"issues": [
|
411
|
-
{
|
412
|
-
"baseName": "AndroidManifest.xml",
|
413
|
-
"category": "Internationalization:Bidirectional Text",
|
414
|
-
"columnEnd": 0,
|
415
|
-
"columnStart": 0,
|
416
|
-
"description": "",
|
417
|
-
"fileName": "/var/lib/jenkins/workspace/Jenkins/Examples/android/MR6--danger/repository/mylibrary/src/main/AndroidManifest.xml",
|
418
|
-
"fingerprint": "4F7305CA47CE9CFC2A8E9BE4287E79F8",
|
419
|
-
"lineEnd": 0,
|
420
|
-
"lineStart": 0,
|
421
|
-
"message": "Using RTL attributes without enabling RTL support\nThe project references RTL attributes, but does not explicitly enable or disable RTL support with `android:supportsRtl` in the manifest\nTo enable right-to-left support, when running on API 17 and higher, you must set the `android:supportsRtl` attribute in the manifest `<application>` element.

If you have started adding RTL attributes, but have not yet finished the migration, you can set the attribute to false to satisfy this lint check.",
|
422
|
-
"moduleName": "",
|
423
|
-
"origin": "android-lint",
|
424
|
-
"packageName": "-",
|
425
|
-
"reference": "3",
|
426
|
-
"severity": "NORMAL",
|
427
|
-
"type": "RtlEnabled",
|
428
|
-
},
|
429
|
-
],
|
630
|
+
"issues": [],
|
430
631
|
}
|
632
|
+
|
633
|
+
items = 0
|
634
|
+
while items < count
|
635
|
+
json[:issues] << {
|
636
|
+
"baseName": filename,
|
637
|
+
"category": "Internationalization:Bidirectional Text",
|
638
|
+
"columnEnd": 0,
|
639
|
+
"columnStart": 0,
|
640
|
+
"description": "",
|
641
|
+
"fileName": "project/src/main/#{filename}",
|
642
|
+
"fingerprint": "4F7305CA47CE9CFC2A8E9BE4287E79F8",
|
643
|
+
"lineEnd": 0,
|
644
|
+
"lineStart": 0,
|
645
|
+
"message": "Using RTL attributes without enabling RTL support\nThe project references RTL attributes, but does not explicitly enable or disable RTL support with `android:supportsRtl` in the manifest\nTo enable right-to-left support, when running on API 17 and higher, you must set the `android:supportsRtl` attribute in the manifest `<application>` element.

If you have started adding RTL attributes, but have not yet finished the migration, you can set the attribute to false to satisfy this lint check.",
|
646
|
+
"moduleName": "",
|
647
|
+
"origin": "android-lint",
|
648
|
+
"packageName": "-",
|
649
|
+
"reference": "3",
|
650
|
+
"severity": "NORMAL",
|
651
|
+
"type": "RtlEnabled",
|
652
|
+
}
|
653
|
+
items += 1
|
654
|
+
end
|
431
655
|
serialized = JSON.generate(json)
|
432
656
|
JSON.parse(serialized)
|
433
657
|
end
|
@@ -446,3 +670,11 @@ end
|
|
446
670
|
def target_files_return(list)
|
447
671
|
@my_plugin.stubs(:target_files).returns(list)
|
448
672
|
end
|
673
|
+
|
674
|
+
def mock_file_in_changeset(value)
|
675
|
+
@my_plugin.stubs(:file_in_changeset?).returns(value)
|
676
|
+
end
|
677
|
+
|
678
|
+
def mock_basename_in_changeset(value)
|
679
|
+
@my_plugin.stubs(:basename_in_changeset?).returns(value)
|
680
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: danger-warnings_next_generation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Kyaak
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-06-
|
11
|
+
date: 2019-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: danger-plugin-api
|
@@ -174,6 +174,7 @@ files:
|
|
174
174
|
- sonar-project.properties
|
175
175
|
- spec/assets/aggregation.json
|
176
176
|
- spec/assets/aggregation_single.json
|
177
|
+
- spec/assets/aggregation_two.json
|
177
178
|
- spec/assets/example/aggregation.json
|
178
179
|
- spec/assets/example/detail_android_lint.json
|
179
180
|
- spec/assets/example/detail_detekt.json
|
@@ -207,13 +208,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
207
208
|
- !ruby/object:Gem::Version
|
208
209
|
version: '0'
|
209
210
|
requirements: []
|
210
|
-
rubygems_version: 3.0.
|
211
|
+
rubygems_version: 3.0.4
|
211
212
|
signing_key:
|
212
213
|
specification_version: 4
|
213
214
|
summary: Read Jenkins warnings-ng reports and comment pull request with found issues.
|
214
215
|
test_files:
|
215
216
|
- spec/assets/aggregation.json
|
216
217
|
- spec/assets/aggregation_single.json
|
218
|
+
- spec/assets/aggregation_two.json
|
217
219
|
- spec/assets/example/aggregation.json
|
218
220
|
- spec/assets/example/detail_android_lint.json
|
219
221
|
- spec/assets/example/detail_detekt.json
|