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 +4 -4
- data/README.md +2 -1
- data/lib/htmllint/gem_version.rb +1 -1
- data/lib/htmllint/plugin.rb +8 -3
- data/spec/htmllint_spec.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f2dd08da6719d8345d00f54caf00f56e6123c0f
|
4
|
+
data.tar.gz: cb6000d1041518ef0733e702ad875b3245d98d69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
|
data/lib/htmllint/gem_version.rb
CHANGED
data/lib/htmllint/plugin.rb
CHANGED
@@ -54,9 +54,12 @@ module Danger
|
|
54
54
|
end
|
55
55
|
|
56
56
|
def parse(result)
|
57
|
-
|
57
|
+
list = []
|
58
|
+
result.split("\n").each do |item|
|
59
|
+
next if item == ""
|
60
|
+
|
58
61
|
path_and_err = item.split(":")
|
59
|
-
|
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)
|
data/spec/htmllint_spec.rb
CHANGED
@@ -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
|