danger-checkstyle_format 0.0.1 → 0.0.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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +2 -1
- data/lib/checkstyle_format/gem_version.rb +1 -1
- data/lib/checkstyle_format/plugin.rb +5 -4
- data/spec/checkstyle_format_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: 245382d3418dad68da9c0b7a78e43e12a3c37539
|
4
|
+
data.tar.gz: d873072e053cccae270afc39a9b246a53afe7ce5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15416beb75052d6cb3ba27a1e83fee925c60005210907fe49d1bda606c4ec0da5ced05a5267a10134f9077483f20249cbc8ef65be2c12099895e7b2013f1f69b
|
7
|
+
data.tar.gz: 06a4c73c61416644fca82a477436968fcf940d6f42f3dcc7879d51f7e628c6299a0b7c33eadbe8eac91d0f6f71cebc9d709bbdbf8972ae5f7d94981f0a164399
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -12,7 +12,8 @@ Danger plugin for checkstyle formatted xml file.
|
|
12
12
|
|
13
13
|
<blockquote>Parse the XML file, and let the plugin do your reporting
|
14
14
|
<pre>
|
15
|
-
checkstyle_format.
|
15
|
+
checkstyle_format.base_path = Dir.pwd
|
16
|
+
checkstyle_format.report 'app/build/reports/checkstyle/checkstyle.xml'</pre>
|
16
17
|
</blockquote>
|
17
18
|
|
18
19
|
## Development
|
@@ -3,7 +3,8 @@ module Danger
|
|
3
3
|
#
|
4
4
|
# @example Parse the XML file, and let the plugin do your reporting
|
5
5
|
#
|
6
|
-
# checkstyle_format.
|
6
|
+
# checkstyle_format.base_path = Dir.pwd
|
7
|
+
# checkstyle_format.report 'app/build/reports/checkstyle/checkstyle.xml'
|
7
8
|
#
|
8
9
|
# @see noboru-i/danger-checkstyle_format
|
9
10
|
# @tags lint, reporting
|
@@ -22,8 +23,6 @@ module Danger
|
|
22
23
|
raise "No checkstyle file was found at #{file}" unless File.exist? file
|
23
24
|
errors = parse(file)
|
24
25
|
|
25
|
-
puts errors.size
|
26
|
-
|
27
26
|
if inline_mode
|
28
27
|
send_inline_comment(errors)
|
29
28
|
else
|
@@ -53,9 +52,11 @@ module Danger
|
|
53
52
|
present_elements = doc.nodes.first.nodes.reject do |test|
|
54
53
|
test.nodes.empty?
|
55
54
|
end
|
55
|
+
base_path_suffix = @base_path.end_with?("/") ? "" : "/"
|
56
|
+
base_path = @base_path + base_path_suffix
|
56
57
|
elements = present_elements.flat_map do |parent|
|
57
58
|
parent.nodes.map do |child|
|
58
|
-
CheckstyleError.generate(child, parent,
|
59
|
+
CheckstyleError.generate(child, parent, base_path)
|
59
60
|
end
|
60
61
|
end
|
61
62
|
|