# ********** Copyright Viacom, Inc. Apache 2.0 ********** module RokuBuilder class LineInspector def initialize(inspector_config:, indent_config:) @inspector_config = inspector_config @indent_config = indent_config end def run(file_path) @warnings = [] File.open(file_path) do |file| in_xml_comment = false indent_inspector = IndentationInspector.new(rules: @indent_config, path: file_path) if @indent_config full_file = [] file_no_comments = [] lines_to_ignore = [] file.readlines.each_with_index do |line, line_number| full_line = line.dup line.gsub!(/'.*/, "") if file_path.end_with?(".brs") if file_path.end_with?(".xml") if in_xml_comment if line.gsub!(/.*-->/, "") in_xml_comment = false else line = "\n" end end line.gsub!(//, "") in_xml_comment = true if line.gsub!(/