def report data
      return nil if data.nil? || data.empty?
      result = ''
      data.each do |file_name, analysis|
        rel_path = File.join('.', File.expand_path(file_name).sub(Dir.pwd, ''))
        result += "\n#{rel_path}\n"
        analysis.each do |line_number, warning|
          result += "  #{line_number}: #{warning.join(',')}\n"
        end
      end
      result.strip!

      result.empty? ? nil : result
    end
def report data
      return nil if data.nil? || data.empty?
      result = ''
      data.each do |file_name, analysis|
        rel_path = File.join('.', File.expand_path(file_name).sub(Dir.pwd, ''))
        result += "\n#{rel_path}\n"
        analysis.each do |line_number, warning|
          result += "  #{line_number}: #{warning.join(',')}\n"
        end
      end
      result.strip!

      result.empty? ? nil : result
    end
Format data into a report