foodcritic-junit 0.2.0 → 0.2.2
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/README.md +2 -0
- data/lib/foodcritic/junit/outputter.rb +19 -10
- data/lib/foodcritic/junit/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f083c412583bf8626f534c4c8a690dd87b994ba8
|
|
4
|
+
data.tar.gz: 9266323d2bac360733467dfb6d5f0d70fbfc5ec2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 233ba0d9cf1026c2a85a5201e3b0ab51f567da541235c8ff637d9ededf4e9c2e1103c38fcf7a445b4993e6956cec83256d4d7282f60ed9d89a5fe91f231e1a59
|
|
7
|
+
data.tar.gz: efc608dc4fee9ef80326855ad1432c1f267195edbf3e27a74b7cc6bfb64987dbbd2cdf8c95baecbcb2b1262068ade495add211017462cba564e1c1d9258c1b6c
|
data/README.md
CHANGED
|
@@ -9,6 +9,8 @@ $ bundle exec foodcritic -C . | bundle exec foodcritic-junit
|
|
|
9
9
|
=> Wrote test/reports/report.xml
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
+

|
|
13
|
+
|
|
12
14
|
## Install
|
|
13
15
|
|
|
14
16
|
In your Gemfile: `gem 'foodcritic-junit'` or just `gem install foodcritic-junit`
|
|
@@ -23,31 +23,40 @@ module Foodcritic
|
|
|
23
23
|
write_output
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
+
def store_violation
|
|
27
|
+
if current_violation
|
|
28
|
+
violations.push({
|
|
29
|
+
rule: current_violation[:rule],
|
|
30
|
+
message: current_violation[:message],
|
|
31
|
+
file_name: current_file_name,
|
|
32
|
+
lines: current_violation_lines.join("\n")
|
|
33
|
+
})
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
26
37
|
def parse_violations
|
|
27
38
|
input.each_line do |line|
|
|
28
39
|
line.chomp!
|
|
29
40
|
|
|
30
|
-
|
|
41
|
+
if File.exist?(line)
|
|
42
|
+
store_violation
|
|
43
|
+
@current_violation = nil
|
|
44
|
+
@current_violation_lines = []
|
|
45
|
+
@current_file_name = line
|
|
46
|
+
end
|
|
31
47
|
|
|
32
48
|
violation = line.match(/(?<rule>[A-Z]+\d+?):\s(?<message>.+?)$/)
|
|
33
49
|
|
|
34
50
|
if violation
|
|
35
51
|
# We got a new violation, store the current one + it's lines
|
|
36
|
-
|
|
37
|
-
violations.push({
|
|
38
|
-
rule: current_violation[:rule],
|
|
39
|
-
message: current_violation[:message],
|
|
40
|
-
file_name: current_file_name,
|
|
41
|
-
lines: current_violation_lines.join("\n")
|
|
42
|
-
})
|
|
43
|
-
end
|
|
44
|
-
|
|
52
|
+
store_violation
|
|
45
53
|
@current_violation = violation
|
|
46
54
|
@current_violation_lines = []
|
|
47
55
|
else
|
|
48
56
|
current_violation_lines << line.lstrip if current_violation_lines
|
|
49
57
|
end
|
|
50
58
|
end
|
|
59
|
+
store_violation
|
|
51
60
|
end
|
|
52
61
|
|
|
53
62
|
def output_file_path
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: foodcritic-junit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Thomas Vendetta
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-
|
|
11
|
+
date: 2017-04-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: foodcritic
|