danger-warnings_next_generation 0.1.2 → 0.1.3
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/lib/warnings_next_generation/gem_version.rb +1 -1
- data/lib/warnings_next_generation/plugin.rb +15 -5
- data/spec/warnings_next_generation_spec.rb +15 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 376645863b3395fb2236750da8d2ea8eccee50a8e99dc805d41f577cd68aa9f6
|
4
|
+
data.tar.gz: 3be7c4925398bcc80ce75690cc78a961cc6466c928e1e8cfd93dc64c9e13ba7c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb291593edf3dc7001d57bc585e31e1cc61e9ab95dcd79b7ad5cbc65ad70d53fd91fc215d1330170ea8ed7338ba49f65f25e59052df4f5c9c469e6f0a39988de
|
7
|
+
data.tar.gz: bee9338b11923f09d46e5ba11d1be3ee42d3d8e99f4102f6a6c28e8ee27d5f87c2e6d9af2aa66ddb1330cf9b8c8eda970e6832d0228c40a46b8d27b03692e935
|
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
|
+
## [0.1.3] - 2019-5-28
|
8
|
+
### Fixed
|
9
|
+
- Target files not initialized
|
10
|
+
- Ignore warning type dash "-"
|
11
|
+
|
7
12
|
## [0.1.2] - 2019-5-27
|
8
13
|
### Fixed
|
9
14
|
- Do not post empty tool report
|
@@ -36,7 +36,7 @@ module Danger
|
|
36
36
|
WNG_OVERVIEW_TITLE = "### Warnings Next Generation Overview"
|
37
37
|
|
38
38
|
def initialize(dangerfile)
|
39
|
-
@target_files =
|
39
|
+
@target_files = nil
|
40
40
|
@auth = nil
|
41
41
|
super(dangerfile)
|
42
42
|
end
|
@@ -200,16 +200,26 @@ module Danger
|
|
200
200
|
type = issue["type"]
|
201
201
|
result = ""
|
202
202
|
|
203
|
-
|
203
|
+
category_valid_ = category_valid?(category)
|
204
|
+
type_valid_ = type_valid?(type)
|
205
|
+
if category_valid_ || type_valid_
|
204
206
|
result = +"["
|
205
|
-
result << category.to_s
|
206
|
-
result << " - " if
|
207
|
-
result << type.to_s
|
207
|
+
result << category.to_s if category_valid_
|
208
|
+
result << " - " if category_valid_ && type_valid_
|
209
|
+
result << type.to_s if type_valid_
|
208
210
|
result << "]"
|
209
211
|
end
|
210
212
|
result
|
211
213
|
end
|
212
214
|
|
215
|
+
def category_valid?(category)
|
216
|
+
category && !category.empty?
|
217
|
+
end
|
218
|
+
|
219
|
+
def type_valid?(type)
|
220
|
+
type && !type.empty? && !type.eql?("-")
|
221
|
+
end
|
222
|
+
|
213
223
|
def tool_entries
|
214
224
|
json = aggregation_result
|
215
225
|
json["tools"]
|
@@ -261,6 +261,21 @@ module Danger
|
|
261
261
|
expect(markdowns.first.message).to include("[TEST_CATEGORY]")
|
262
262
|
end
|
263
263
|
|
264
|
+
it "type is dash not added" do
|
265
|
+
aggregation_return("/assets/aggregation_single.json")
|
266
|
+
issues = android_lint_issues
|
267
|
+
issue = issues["issues"].first
|
268
|
+
issue["category"] = "TEST_CATEGORY"
|
269
|
+
issue["type"] = "-"
|
270
|
+
details_return_issue(issues)
|
271
|
+
target_files_return_manifest
|
272
|
+
@my_plugin.tools_report
|
273
|
+
|
274
|
+
markdowns = @dangerfile.status_report[:markdowns]
|
275
|
+
expect(markdowns.length).to be(1)
|
276
|
+
expect(markdowns.first.message).to include("[TEST_CATEGORY]")
|
277
|
+
end
|
278
|
+
|
264
279
|
it "type nil not added" do
|
265
280
|
aggregation_return("/assets/aggregation_single.json")
|
266
281
|
issues = android_lint_issues
|
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.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Schwamberger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: danger-plugin-api
|