danger-checkstyle_xml 0.0.3 → 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: 258f42658fb6340318ebe52c9f7cb905ced63c26399d375b83a4b5f74818ac30
4
- data.tar.gz: 9f8d3825b0d46a4f3c01e92d52df5d3a60c49c16bec72d3c561d14cc84329842
3
+ metadata.gz: 6a8b8d75c19a4f35e52e7b693c59a9fd0408d5a0bf3366d29d9c3d994c7ce1ec
4
+ data.tar.gz: 4ca58f174e08d545f78f37537b25db80944f022df0cf9a4d8a3acc6e75f2ab70
5
5
  SHA512:
6
- metadata.gz: 9d5c58ea3c4e369bd5c825d0148880231107ab0cdffd644f4c0a6983f6fcf57c36045ee45fad1a44a7fe241b76aaf95393a72e3d357d1b6d8cc945a150b69eb4
7
- data.tar.gz: 5fdb28f9d9cf07fc3aa1462c9932e96b1bd3b98f2f5ed2c7451a66a5f4fc9c2e6a8e9cae0d38c05c1e06302477cfedfeab361af5ad1149db5c1374e7bbb2decc
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, base_path)
5
- # Print base path, full path, and relative path
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,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CheckstyleFormat
4
- VERSION = "0.0.3".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.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - noboru-i