def METHOD_NAME(self, cmd: CompileCommand) -> str:
    """
    Converts the result to a report string.
    """
    cmd_line_str = shlex_join(self.compiler_cmd_line)
    report_helper = ReportHelper()
    report_helper.add_items([
        ("Compiler input file", cmd.rel_file_path),
        ("Command line", cmd_line_str),
        ("Success", str(self.success)),
    ])
    if self.stdout and self.stdout.strip():
        report_helper.add_item("Compiler standard output", self.stdout.rstrip() + "\n")
    if self.stderr and self.stderr.strip():
        report_helper.add_item("Compiler standard error", self.stderr.rstrip() + "\n")
    if self.exit_code != 0:
        report_helper.add_item("Compiler exit code", str(self.exit_code))
    if self.failure_reason:
        report_helper.add_item("Failure reason", self.failure_reason)
    if self.extra_messages:
        report_helper.add_raw_lines(self.extra_messages)
    return report_helper.as_str()