# frozen_string_literal: true CheckstyleError = Struct.new(:file_name, :line, :column, :severity, :message, :source) do def self.generate(node, parent_node, base_path) # Print base path, full path, and relative path puts "Base path: #{base_path}" puts "Parent node path: #{parent_node[:name]}" relative_path = parent_node[:name].sub(/^#{base_path}/, "") puts "Relative path: #{relative_path}" CheckstyleError.new( relative_path, node[:line].to_i, node[:column]&.to_i, node[:severity], node[:message], node[:source] ) end end