danger-warnings_next_generation 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ca8908ac2dbb49d19073752e2f3080d18619db630da9458e4f3cf5754c0e5e10
4
- data.tar.gz: 46682178b08d1c87e250bbe9a8910603efcea9f23abb5d3f6ca7ddb31fc66be4
3
+ metadata.gz: 376645863b3395fb2236750da8d2ea8eccee50a8e99dc805d41f577cd68aa9f6
4
+ data.tar.gz: 3be7c4925398bcc80ce75690cc78a961cc6466c928e1e8cfd93dc64c9e13ba7c
5
5
  SHA512:
6
- metadata.gz: 42b11cee07c972faacb608b1dac054dc2f7cec481b693179e74e139045cf5e8f8ae6d874c8b6fa55e0b49be6291856950bea4aaef714dd2142dcb414d75f891a
7
- data.tar.gz: 48c2a489c9681d53ca4fe04c3382f955583ab26fc6dc144dc431f56056f3ab6bcf12868f577a709ea74db222f3f55dc7e76aa632db7f961c0cee05155309b137
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WarningsNextGeneration
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
@@ -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
- if (category && !category.empty?) || (type && !type.empty?)
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 unless category&.empty?
206
- result << " - " if (category && !category.empty?) && (type && !type.empty?)
207
- result << type.to_s unless type&.empty?
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.2
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-27 00:00:00.000000000 Z
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