Skip to content

Commit

Permalink
Merge pull request #381 from machow/fix-multiline-signature
Browse files Browse the repository at this point in the history
Fix: add trailing commas to multiline signature
  • Loading branch information
machow authored Nov 8, 2024
2 parents 5fa28ec + 5274a16 commit ee4fa3c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion quartodoc/renderers/md_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions quartodoc/tests/__snapshots__/test_renderers.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
```

Expand All @@ -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,
)
```

Expand Down

0 comments on commit ee4fa3c

Please sign in to comment.