danger-checkstyle_xml 0.0.2 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
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,9 +1,11 @@
|
|
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,
|
4
|
+
def self.generate(node, parent_node, sub_regex)
|
5
|
+
relative_path = parent_node[:name].sub(sub_regex, "")
|
6
|
+
|
5
7
|
CheckstyleError.new(
|
6
|
-
|
8
|
+
relative_path,
|
7
9
|
node[:line].to_i,
|
8
10
|
node[:column]&.to_i,
|
9
11
|
node[:severity],
|
@@ -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
|