Skip to content

Commit

Permalink
add missing space on required args in markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
ipmb committed Feb 10, 2024
1 parent a93ab42 commit 59467fb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Change Log
==========

Unreleased
==========

- Another markdown output fix

4.0.1 (10 February 2024)
========================

Expand Down
2 changes: 1 addition & 1 deletion goodconf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def generate_markdown(cls) -> str:
for k, v in cls.__fields__.items():
lines.append(f"* **{k}**")
if v.required:
lines[-1] = lines[-1] + "_REQUIRED_"
lines[-1] = lines[-1] + " _REQUIRED_"
if v.field_info.description:
lines.append(f" * description: {v.field_info.description}")
lines.append(f" * type: `{type_to_str(v.outer_type_)}`")
Expand Down
7 changes: 7 additions & 0 deletions tests/test_goodconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,13 @@ class TestConf(GoodConf):
assert " * type: `Literal['a', 'b']`" in lines
assert " * type: `list[str]`" in lines

def test_generate_markdown_required():
class TestConf(GoodConf):
a: str

lines = TestConf.generate_markdown().splitlines()
assert "* **a** _REQUIRED_" in lines


def test_undefined():
c = GoodConf()
Expand Down

0 comments on commit 59467fb

Please sign in to comment.