from __future__ import annotations from typing import TYPE_CHECKING if TYPE_CHECKING: from ruff_ecosystem.projects import Project def markdown_project_section( title: str, content: str | list[str], options: str, project: Project ) -> list[str]: return markdown_details( summary=f'{project.repo.fullname} ({title})', # Show the command used for the check preface="
ruff " + " ".join(options.to_cli_args()) + "
", content=content, ) def markdown_details(summary: str, preface: str, content: str | list[str]): lines = [] lines.append(f"
{summary}") lines.append("

") lines.append(preface) lines.append("

") lines.append("

") lines.append("") if isinstance(content, str): lines.append(content) else: lines.extend(content) lines.append("") lines.append("

") lines.append("
") return lines