diff --git a/python/ruff-ecosystem/ruff_ecosystem/markdown.py b/python/ruff-ecosystem/ruff_ecosystem/markdown.py index 602341ca39..e6f6060695 100644 --- a/python/ruff-ecosystem/ruff_ecosystem/markdown.py +++ b/python/ruff-ecosystem/ruff_ecosystem/markdown.py @@ -11,9 +11,13 @@ def markdown_project_section( ) -> list[str]: return markdown_details( summary=f'{project.repo.fullname} ({title})', - # Show the command used for the check - preface="
ruff " + " ".join(options.to_ruff_args()) + "", content=content, + preface=( + # Show the command used for the check if the options are non-default + "
ruff " + " ".join(options.to_ruff_args()) + "" + if options != type(options)() + else None + ), ) @@ -24,12 +28,13 @@ def markdown_plus_minus(added: int, removed: int) -> str: return f"+{added} -{removed}" -def markdown_details(summary: str, preface: str, content: str | list[str]): +def markdown_details(summary: str, content: str | list[str], preface: str): lines = [] lines.append(f"
") - lines.append(preface) - lines.append("
") + if preface: + lines.append("") + lines.append(preface) + lines.append("
") lines.append("") lines.append("")