danger-checkstyle_xml 0.0.3 → 0.0.4
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a8b8d75c19a4f35e52e7b693c59a9fd0408d5a0bf3366d29d9c3d994c7ce1ec
|
4
|
+
data.tar.gz: 4ca58f174e08d545f78f37537b25db80944f022df0cf9a4d8a3acc6e75f2ab70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8dade669190655478d6fbae812cfc4104b12b3a5b891d9f40eb3fa34f8e650f97ada8a1fc9a5235295c5579874319a26ff4450bb57f5ebe77bff19f5a3f9d7f2
|
7
|
+
data.tar.gz: 92095613700a1afbd85e2d2564b26daf5b93bea11c5b0e4650abb71f3561d59cee2d416134135cab075c9bcce0600809379fe59b631dc6bf58930332a6cc4748
|
@@ -1,13 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
CheckstyleError = Struct.new(:file_name, :line, :column, :severity, :message, :source) do
|
4
|
-
def self.generate(node, parent_node,
|
5
|
-
|
6
|
-
puts "Base path: #{base_path}"
|
7
|
-
puts "Parent node path: #{parent_node[:name]}"
|
8
|
-
|
9
|
-
relative_path = parent_node[:name].sub(/^#{base_path}/, "")
|
10
|
-
puts "Relative path: #{relative_path}"
|
4
|
+
def self.generate(node, parent_node, sub_regex)
|
5
|
+
relative_path = parent_node[:name].sub(sub_regex, "")
|
11
6
|
|
12
7
|
CheckstyleError.new(
|
13
8
|
relative_path,
|
@@ -58,13 +58,12 @@ module Danger
|
|
58
58
|
test.nodes.empty?
|
59
59
|
end
|
60
60
|
|
61
|
-
base_path_suffix = @base_path.end_with?("/") ? "" : "/"
|
62
|
-
|
63
|
-
base_path = @base_path + base_path_suffix
|
61
|
+
# base_path_suffix = @base_path.end_with?("/") ? "" : "/"
|
62
|
+
# base_path = @base_path + base_path_suffix
|
64
63
|
|
65
64
|
present_elements.flat_map do |parent|
|
66
65
|
parent.nodes.map do |child|
|
67
|
-
CheckstyleError.generate(child, parent, base_path)
|
66
|
+
CheckstyleError.generate(child, parent, @base_path)
|
68
67
|
end
|
69
68
|
end
|
70
69
|
end
|