foodcritic-junit 0.1.5 → 0.1.6
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 +4 -4
- data/lib/foodcritic/junit/outputter.rb +8 -7
- data/lib/foodcritic/junit/version.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: a3c5023726931552afcfb5475468cbb5b99fd78b
|
|
4
|
+
data.tar.gz: 82910a0f5e7bf374c0fc6b9e35877c5f63b21413
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c5c0c319a0f5e5f0c2164ca3d46f0f369254c31b360a7407ed1f7084e8e961d2c39fb227f05f613224465d73f12c84f001dbac7244a1acc171a45f022fdd386b
|
|
7
|
+
data.tar.gz: 70d41c66aa38dafa600ce94ecc62c363fc19dd289c23e568815f2e1412d30030ace0cb1c695bb32525730d7cc9f38784d39135661b93c5e89534828ccc0e26fd
|
|
@@ -45,7 +45,7 @@ module Foodcritic
|
|
|
45
45
|
@current_violation = violation
|
|
46
46
|
@current_violation_lines = []
|
|
47
47
|
else
|
|
48
|
-
current_violation_lines << line
|
|
48
|
+
current_violation_lines << line if current_violation_lines
|
|
49
49
|
end
|
|
50
50
|
end
|
|
51
51
|
end
|
|
@@ -64,7 +64,7 @@ module Foodcritic
|
|
|
64
64
|
<<-EOS
|
|
65
65
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
66
66
|
<testsuites>
|
|
67
|
-
<testsuite name
|
|
67
|
+
<testsuite name=#{cookbook_name.encode(xml: :attr)} timestamp=#{Time.now.utc.iso8601.to_s.encode(xml: :attr)}>
|
|
68
68
|
#{violations_as_xml}
|
|
69
69
|
</testsuite>
|
|
70
70
|
</testsuites>
|
|
@@ -80,12 +80,13 @@ module Foodcritic
|
|
|
80
80
|
end
|
|
81
81
|
|
|
82
82
|
def xml_for_violation(violation)
|
|
83
|
-
name = "#{violation[:rule]}: #{violation[:message]}"
|
|
84
|
-
file_name = violation[:file_name]
|
|
83
|
+
name = "#{violation[:rule]}: #{violation[:message]}".encode(xml: :attr)
|
|
84
|
+
file_name = violation[:file_name].encode(xml: :attr)
|
|
85
|
+
location = "Located in #{violation[:file_name]}".encode(xml: :attr)
|
|
85
86
|
<<-EOS
|
|
86
|
-
<testcase name
|
|
87
|
-
<error type
|
|
88
|
-
#{violation[:lines]}
|
|
87
|
+
<testcase name=#{name} classname=#{file_name} assertions="0" time="0">
|
|
88
|
+
<error type=#{name} message=#{location}>
|
|
89
|
+
#{violation[:lines].encode(xml: :text)}
|
|
89
90
|
</error>
|
|
90
91
|
</testcase>
|
|
91
92
|
EOS
|