From 311a7751f97d1559a4e1a0a1b81a2b24029b3d9c Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Mon, 6 Nov 2023 09:35:07 -0600 Subject: [PATCH] Ensure ecosystem project errors are properly fenced (#8516) Fixes bug where errors could be unfenced resulting in hidden remaining content e.g. https://github.com/astral-sh/ruff/pull/8508#issuecomment-1794960132 --- python/ruff-ecosystem/ruff_ecosystem/check.py | 2 +- python/ruff-ecosystem/ruff_ecosystem/format.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python/ruff-ecosystem/ruff_ecosystem/check.py b/python/ruff-ecosystem/ruff_ecosystem/check.py index 5270a97e43..2e996ff006 100644 --- a/python/ruff-ecosystem/ruff_ecosystem/check.py +++ b/python/ruff-ecosystem/ruff_ecosystem/check.py @@ -200,7 +200,7 @@ def markdown_check_result(result: Result) -> str: lines.extend( markdown_project_section( title="error", - content=f"```\n{error}```", + content=f"```\n{str(error).strip()}\n```", options=project.check_options, project=project, ) diff --git a/python/ruff-ecosystem/ruff_ecosystem/format.py b/python/ruff-ecosystem/ruff_ecosystem/format.py index be6a90f5b4..f639150a86 100644 --- a/python/ruff-ecosystem/ruff_ecosystem/format.py +++ b/python/ruff-ecosystem/ruff_ecosystem/format.py @@ -84,7 +84,7 @@ def markdown_format_result(result: Result) -> str: lines.extend( markdown_project_section( title="error", - content=f"```\n{error}```", + content=f"```\n{str(error).strip()}\n```", options=project.format_options, project=project, )