From 016e9dbb4d26936fd34cd3bf0fcdb65337b31efd Mon Sep 17 00:00:00 2001 From: Michael Chow Date: Fri, 8 Nov 2024 15:31:32 -0500 Subject: [PATCH 1/2] fix: add commas to multiline signature --- quartodoc/renderers/md_renderer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quartodoc/renderers/md_renderer.py b/quartodoc/renderers/md_renderer.py index 51cbd87..049d92f 100644 --- a/quartodoc/renderers/md_renderer.py +++ b/quartodoc/renderers/md_renderer.py @@ -268,7 +268,7 @@ def signature( flat_sig = f"{name}({', '.join(pars)})" if len(flat_sig) > 80: - indented = [" " * 4 + par for par in pars] + indented = [" " * 4 + par + "," for par in pars] sig = "\n".join([f"{name}(", *indented, ")"]) else: sig = flat_sig From 5274a1670f5033e5e55395960d25514977a7ead6 Mon Sep 17 00:00:00 2001 From: Michael Chow Date: Fri, 8 Nov 2024 15:31:51 -0500 Subject: [PATCH 2/2] tests: update snapshots --- quartodoc/tests/__snapshots__/test_renderers.ambr | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/quartodoc/tests/__snapshots__/test_renderers.ambr b/quartodoc/tests/__snapshots__/test_renderers.ambr index 0d99ba9..6a1625c 100644 --- a/quartodoc/tests/__snapshots__/test_renderers.ambr +++ b/quartodoc/tests/__snapshots__/test_renderers.ambr @@ -5,9 +5,9 @@ ```python tests.example_signature.a_complex_signature( - x: list[C | int | None] - y: pathlib.Pathlib - z + x: list[C | int | None], + y: pathlib.Pathlib, + z, ) ``` @@ -26,9 +26,9 @@ ```python tests.example_signature.a_complex_signature( - x: list[C | int | None] - y: pathlib.Pathlib - z + x: list[C | int | None], + y: pathlib.Pathlib, + z, ) ```