danger-htmllint 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 498c7ae52de27678bd30845a7ddc5d010274f521
4
- data.tar.gz: 71e34242c04e6073dc6bf1d7b4b215d1df481376
3
+ metadata.gz: 5f2dd08da6719d8345d00f54caf00f56e6123c0f
4
+ data.tar.gz: cb6000d1041518ef0733e702ad875b3245d98d69
5
5
  SHA512:
6
- metadata.gz: b786bc362d77dc8bc971d1d8607a786228695999463d0941caa98f6e4c514c7ae92fc7a68744dba9daff39dafc2119fb7ab2826f44bec3195d3a8d150008d37c
7
- data.tar.gz: c641b3a8d75df2af349a62200413ab0b0981cfc78ea64a11cd817e152e65d29703558abf1bd252843002309c38594c576cc4138925069ff6494438cdb2171049
6
+ metadata.gz: 58ca4ab7d99a7e6666ade36fe3dcd3b321e914fb77726d7b606aecd384ddd061543bc52aacfc79ac6c81f12d1b182c37488a23ea1956e404442eedbc5426a597
7
+ data.tar.gz: 18d473ef1c3c1682cd9e5de49c64b95cff94256899bea81faf4c8b5ff5e9d115473b97670455a2ce01d2203aaf7019fffd45a67dc476e8a31f1873eacf99e1e1
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
1
  # danger-htmllint
2
+ [![Gem Version](https://badge.fury.io/rb/danger-htmllint.svg)](https://badge.fury.io/rb/danger-htmllint)
2
3
  [![](https://github.com/konifar/danger-htmllint/workflows/CI/badge.svg)](https://github.com/konifar/danger-htmllint/actions)
3
4
 
4
5
  [Danger](http://danger.systems/ruby/) plugin for [htmllint](http://htmllint.github.io/).
@@ -7,7 +8,7 @@
7
8
 
8
9
  $ gem install danger-htmllint
9
10
 
10
- `danger-htmllint` depends on [`htmllint-cli`]((https://github.com/htmllint/htmllint-cli)). You need to install it before running Danger.
11
+ danger-htmllint depends on [htmllint-cli]((https://github.com/htmllint/htmllint-cli)). You need to install it before running Danger.
11
12
 
12
13
  ## Usage
13
14
 
@@ -1,3 +1,3 @@
1
1
  module Htmllint
2
- VERSION = "0.1.0".freeze
2
+ VERSION = "0.1.1".freeze
3
3
  end
@@ -54,9 +54,12 @@ module Danger
54
54
  end
55
55
 
56
56
  def parse(result)
57
- result.split("\n").flat_map do |item|
57
+ list = []
58
+ result.split("\n").each do |item|
59
+ next if item == ""
60
+
58
61
  path_and_err = item.split(":")
59
- break if path_and_err.empty?
62
+ next if path_and_err.length < 2
60
63
 
61
64
  file_path = path_and_err.first
62
65
 
@@ -65,13 +68,15 @@ module Danger
65
68
  col = line_col_err_msg[1].sub("col ", "")
66
69
  err_msg = line_col_err_msg[2]
67
70
 
68
- {
71
+ list << {
69
72
  file_path: file_path,
70
73
  line: line,
71
74
  severity: severity_level(fail_on_error),
72
75
  message: "#{err_msg} (col:#{col})"
73
76
  }
74
77
  end
78
+
79
+ list
75
80
  end
76
81
 
77
82
  def severity_level(fail_on_error)
@@ -20,7 +20,7 @@ module Danger
20
20
 
21
21
  context "when result has 2 errors" do
22
22
  let(:fixture) do
23
- "app/index.html: line 1, col 1, tag names must be lowercase\nindex.html: line 592, col 1, indenting spaces must be used in groups of 2\n"
23
+ "app/index.html: line 1, col 1, tag names must be lowercase\nindex.html: line 592, col 1, indenting spaces must be used in groups of 2\n\n[htmllint] found 3 errors out of 62 files\n"
24
24
  end
25
25
 
26
26
  it "has 2 errors" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger-htmllint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - konifar