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: 94eb38da0ed062f5a035d69c8106e665406527b5ad41d4d77225d1452e3d55c5
4
- data.tar.gz: 6ad1a4a5277c2621c4de01f3433b8d450bb1e02c04a96d94915b9883c0721bb2
3
+ metadata.gz: 6a8b8d75c19a4f35e52e7b693c59a9fd0408d5a0bf3366d29d9c3d994c7ce1ec
4
+ data.tar.gz: 4ca58f174e08d545f78f37537b25db80944f022df0cf9a4d8a3acc6e75f2ab70
5
5
  SHA512:
6
- metadata.gz: 399d7e86b99b27eb38b52336e0bf8cc36132757290b357629e3ff258c1cea089167b537831a4613cc365c660e62f22bbb8e3f4add395cb6c7afd0d05597f99ae
7
- data.tar.gz: 2e3f4480d1dcbc16517588b26402d0510efb80d5f0bf9025f2f6add6abe5f52b1e915f66f9269a8894a8b7d094591f5d84d7bfe4daa1e0d2a2114bb957f9ab80
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, base_path)
4
+ def self.generate(node, parent_node, sub_regex)
5
+ relative_path = parent_node[:name].sub(sub_regex, "")
6
+
5
7
  CheckstyleError.new(
6
- parent_node[:name].sub(/^#{base_path}/, ""),
8
+ relative_path,
7
9
  node[:line].to_i,
8
10
  node[:column]&.to_i,
9
11
  node[:severity],
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CheckstyleFormat
4
- VERSION = "0.0.2".freeze
4
+ VERSION = "0.0.4".freeze
5
5
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger-checkstyle_xml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - noboru-i