Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add period to end of new plugin statements in changelog #162

Merged
merged 16 commits into from
May 18, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/antsibull_changelog/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,19 @@ def from_dict(

for plugin_type, plugin_data in data.items():
for plugin_name, plugin_details in plugin_data.items():
if plugin_details["description"]:
if plugin_details["description"].endswith("."):
description = plugin_details["description"]
else:
description = plugin_details["description"] + "."
else:
description = plugin_details["description"]
samccann marked this conversation as resolved.
Show resolved Hide resolved
plugins.append(
PluginDescription(
plugin_type=plugin_type,
name=plugin_name,
namespace=plugin_details.get("namespace"),
description=plugin_details["description"],
description=description,
version_added=plugin_details["version_added"],
category=category,
)
Expand Down
38 changes: 19 additions & 19 deletions tests/functional/test_changelog_basic_ansible.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,15 @@ def test_changelog_release_ansible_simple( # pylint: disable=redefined-outer-na
assert changelog["releases"]["2.10"]["modules"] == [
{
"name": "test",
"description": "This is a test module",
"description": "This is a test module.",
"namespace": "",
},
]
assert changelog["releases"]["2.10"]["plugins"] == {
"lookup": [
{
"name": "bar",
"description": "A foo bar lookup",
"description": "A foo bar lookup.",
"namespace": None,
},
],
Expand Down Expand Up @@ -308,12 +308,12 @@ def test_changelog_release_ansible_simple( # pylint: disable=redefined-outer-na
Lookup
~~~~~~

- bar - A foo bar lookup
- bar - A foo bar lookup.

New Modules
-----------

- test - This is a test module
- test - This is a test module.
"""
)

Expand Down Expand Up @@ -399,15 +399,15 @@ def test_changelog_release_ansible_simple( # pylint: disable=redefined-outer-na
assert changelog["releases"]["2.10"]["modules"] == [
{
"name": "test",
"description": "This is a TEST module",
"description": "This is a TEST module.",
"namespace": "",
},
]
assert changelog["releases"]["2.10"]["plugins"] == {
"lookup": [
{
"name": "bar",
"description": "A foo_bar lookup",
"description": "A foo_bar lookup.",
"namespace": None,
},
],
Expand Down Expand Up @@ -441,12 +441,12 @@ def test_changelog_release_ansible_simple( # pylint: disable=redefined-outer-na
Lookup
~~~~~~

- bar - A foo_bar lookup
- bar - A foo_bar lookup.

New Modules
-----------

- test - This is a TEST module
- test - This is a TEST module.
"""
)

Expand Down Expand Up @@ -539,7 +539,7 @@ def test_changelog_release_ansible_simple( # pylint: disable=redefined-outer-na
assert changelog["releases"]["2.10.1b1"]["modules"] == [
{
"name": "test_new",
"description": "This is ANOTHER test module",
"description": "This is ANOTHER test module.",
"namespace": "",
},
]
Expand Down Expand Up @@ -569,7 +569,7 @@ def test_changelog_release_ansible_simple( # pylint: disable=redefined-outer-na
New Modules
-----------

- test_new - This is ANOTHER test module
- test_new - This is ANOTHER test module.

v2.10
=====
Expand All @@ -592,12 +592,12 @@ def test_changelog_release_ansible_simple( # pylint: disable=redefined-outer-na
Lookup
~~~~~~

- bar - A foo_bar lookup
- bar - A foo_bar lookup.

New Modules
-----------

- test - This is a TEST module
- test - This is a TEST module.
"""
)

Expand Down Expand Up @@ -706,7 +706,7 @@ def test_changelog_release_ansible_simple( # pylint: disable=redefined-outer-na
assert changelog["releases"]["2.10.1"]["modules"] == [
{
"name": "test_new2",
"description": "This is ANOTHER test module!!!11",
"description": "This is ANOTHER test module!!!11.",
"namespace": "",
},
{
Expand Down Expand Up @@ -747,8 +747,8 @@ def test_changelog_release_ansible_simple( # pylint: disable=redefined-outer-na
New Modules
-----------

- test_new - This is ANOTHER test module
- test_new2 - This is ANOTHER test module!!!11
- test_new - This is ANOTHER test module.
- test_new2 - This is ANOTHER test module!!!11.
- test_new3 - This is yet another test module.

v2.10
Expand All @@ -772,12 +772,12 @@ def test_changelog_release_ansible_simple( # pylint: disable=redefined-outer-na
Lookup
~~~~~~

- bar - A foo_bar lookup
- bar - A foo_bar lookup.

New Modules
-----------

- test - This is a TEST module
- test - This is a TEST module.
"""
)

Expand Down Expand Up @@ -1113,7 +1113,7 @@ def test_changelog_release_ansible_plugin_cache( # pylint: disable=redefined-ou
assert changelog["releases"]["2.10"]["modules"][0]["namespace"] == ""
assert (
changelog["releases"]["2.10"]["modules"][0]["description"]
== "A test module"
== "A test module."
)
assert "version_added" not in changelog["releases"]["2.10"]["modules"][0]

Expand All @@ -1135,7 +1135,7 @@ def test_changelog_release_ansible_plugin_cache( # pylint: disable=redefined-ou
New Modules
-----------

- test_module - A test module
- test_module - A test module.
"""
)

Expand Down
24 changes: 12 additions & 12 deletions tests/functional/test_changelog_basic_ansible_classic.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,12 +291,12 @@ def test_changelog_release_ansible_simple( # pylint: disable=redefined-outer-na
Lookup
~~~~~~

- bar - A foo bar lookup
- bar - A foo bar lookup.

New Modules
-----------

- test - This is a test module
- test - This is a test module.
"""
)

Expand Down Expand Up @@ -405,12 +405,12 @@ def test_changelog_release_ansible_simple( # pylint: disable=redefined-outer-na
Lookup
~~~~~~

- bar - A foo_bar lookup
- bar - A foo_bar lookup.

New Modules
-----------

- test - This is a TEST module
- test - This is a TEST module.
"""
)

Expand Down Expand Up @@ -521,7 +521,7 @@ def test_changelog_release_ansible_simple( # pylint: disable=redefined-outer-na
New Modules
-----------

- test_new - This is ANOTHER test module
- test_new - This is ANOTHER test module.

v2.9
====
Expand All @@ -544,12 +544,12 @@ def test_changelog_release_ansible_simple( # pylint: disable=redefined-outer-na
Lookup
~~~~~~

- bar - A foo_bar lookup
- bar - A foo_bar lookup.

New Modules
-----------

- test - This is a TEST module
- test - This is a TEST module.
"""
)

Expand Down Expand Up @@ -683,8 +683,8 @@ def test_changelog_release_ansible_simple( # pylint: disable=redefined-outer-na
New Modules
-----------

- test_new - This is ANOTHER test module
- test_new2 - This is ANOTHER test module!!!11
- test_new - This is ANOTHER test module.
- test_new2 - This is ANOTHER test module!!!11.
- test_new3 - This is yet another test module.

v2.9
Expand All @@ -708,12 +708,12 @@ def test_changelog_release_ansible_simple( # pylint: disable=redefined-outer-na
Lookup
~~~~~~

- bar - A foo_bar lookup
- bar - A foo_bar lookup.

New Modules
-----------

- test - This is a TEST module
- test - This is a TEST module.
"""
)

Expand Down Expand Up @@ -1042,7 +1042,7 @@ def test_changelog_release_ansible_plugin_cache( # pylint: disable=redefined-ou
New Modules
-----------

- test_module - A test module
- test_module - A test module.
"""
)

Expand Down
Loading