Skip to content

Commit 62001e6

Browse files
authored
Strip argument documentation from command help text. (#4451)
Click stops processing docstrings when it encounters a formfeed (\f) character. We can use this to keep the method argument documentation out of the command help syntax. See https://click.palletsprojects.com/en/stable/documentation/#truncating-help-texts
1 parent d8cee0d commit 62001e6

File tree

19 files changed

+38
-19
lines changed

19 files changed

+38
-19
lines changed

src/molecule/command/check.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def check( # noqa: PLR0913
7373
) -> None: # pragma: no cover
7474
"""Use the provisioner to perform a Dry-Run (destroy, dependency, create, prepare, converge).
7575
76+
\f
7677
Args:
7778
ctx: Click context object holding commandline arguments.
7879
scenario_name: Name of the scenario to target.
@@ -81,7 +82,7 @@ def check( # noqa: PLR0913
8182
parallel: Whether the scenario(s) should be run in parallel.
8283
report: Whether to show an after-run summary report.
8384
shared_inventory: Whether the inventory should be shared between scenarios.
84-
"""
85+
""" # noqa: D301
8586
args: MoleculeArgs = ctx.obj.get("args")
8687
subcommand = base._get_subcommand(__name__) # noqa: SLF001
8788
command_args: CommandArgs = {

src/molecule/command/cleanup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,15 @@ def cleanup(
7272
7373
Any changes made to external systems during the stages of testing.
7474
75+
\f
7576
Args:
7677
ctx: Click context object holding commandline arguments.
7778
scenario_name: Name of the scenario to target.
7879
exclude: Name of the scenarios to avoid targeting.
7980
__all: Whether molecule should target scenario_name or all scenarios.
8081
report: Whether to show an after-run summary report.
8182
shared_inventory: Whether the inventory should be shared between scenarios.
82-
"""
83+
""" # noqa: D301
8384
args: MoleculeArgs = ctx.obj.get("args")
8485
subcommand = base._get_subcommand(__name__) # noqa: SLF001
8586
command_args: CommandArgs = {

src/molecule/command/converge.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ def converge( # noqa: PLR0913
6868
) -> None: # pragma: no cover
6969
"""Use the provisioner to configure instances (dependency, create, prepare converge).
7070
71+
\f
7172
Args:
7273
ctx: Click context object holding commandline arguments.
7374
scenario_name: Name of the scenario to target.
@@ -76,7 +77,7 @@ def converge( # noqa: PLR0913
7677
ansible_args: Arguments to forward to Ansible.
7778
report: Whether to show an after-run summary report.
7879
shared_inventory: Whether the inventory should be shared between scenarios.
79-
"""
80+
""" # noqa: D301
8081
args: MoleculeArgs = ctx.obj.get("args")
8182
subcommand = base._get_subcommand(__name__) # noqa: SLF001
8283
command_args: CommandArgs = {

src/molecule/command/create.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ def create( # noqa: PLR0913
8383
) -> None: # pragma: no cover
8484
"""Use the provisioner to start the instances.
8585
86+
\f
8687
Args:
8788
ctx: Click context object holding commandline arguments.
8889
scenario_name: Name of the scenario to target.
@@ -91,7 +92,7 @@ def create( # noqa: PLR0913
9192
__all: Whether molecule should target scenario_name or all scenarios.
9293
report: Whether to show an after-run summary report.
9394
shared_inventory: Whether the inventory should be shared between scenarios.
94-
"""
95+
""" # noqa: D301
9596
args: MoleculeArgs = ctx.obj.get("args")
9697
subcommand = base._get_subcommand(__name__) # noqa: SLF001
9798
command_args: CommandArgs = {

src/molecule/command/dependency.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,15 @@ def dependency(
6565
) -> None: # pragma: no cover
6666
"""Manage the role's dependencies.
6767
68+
\f
6869
Args:
6970
ctx: Click context object holding commandline arguments.
7071
scenario_name: Name of the scenario to target.
7172
exclude: Name of the scenarios to avoid targeting.
7273
__all: Whether molecule should target scenario_name or all scenarios.
7374
report: Whether to show an after-run summary report.
7475
shared_inventory: Whether the inventory should be shared between scenarios.
75-
"""
76+
""" # noqa: D301
7677
args: MoleculeArgs = ctx.obj.get("args")
7778
subcommand = base._get_subcommand(__name__) # noqa: SLF001
7879
command_args: CommandArgs = {

src/molecule/command/destroy.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ def destroy( # noqa: PLR0913
8787
) -> None: # pragma: no cover
8888
"""Use the provisioner to destroy the instances.
8989
90+
\f
9091
Args:
9192
ctx: Click context object holding commandline arguments.
9293
scenario_name: Name of the scenario to target.
@@ -96,7 +97,7 @@ def destroy( # noqa: PLR0913
9697
parallel: Whether the scenario(s) should be run in parallel mode.
9798
report: Whether to show an after-run summary report.
9899
shared_inventory: Whether the inventory should be shared between scenarios.
99-
"""
100+
""" # noqa: D301
100101
args: MoleculeArgs = ctx.obj.get("args")
101102
subcommand = base._get_subcommand(__name__) # noqa: SLF001
102103
command_args: CommandArgs = {

src/molecule/command/drivers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,11 @@ def drivers(
4848
) -> None: # pragma: no cover
4949
"""List drivers.
5050
51+
\f
5152
Args:
5253
ctx: Click context object holding commandline arguments.
5354
format: Output format to use.
54-
"""
55+
""" # noqa: D301
5556
drivers = [] # pylint: disable=redefined-outer-name
5657
for driver in api.drivers().values():
5758
description = str(driver)

src/molecule/command/idempotence.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ def idempotence( # noqa: PLR0913
138138
139139
After parse the output to determine idempotence.
140140
141+
\f
141142
Args:
142143
ctx: Click context object holding commandline arguments.
143144
scenario_name: Name of the scenario to target.
@@ -146,7 +147,7 @@ def idempotence( # noqa: PLR0913
146147
ansible_args: Arguments to forward to Ansible.
147148
report: Whether to show an after-run summary report.
148149
shared_inventory: Whether the inventory should be shared between scenarios.
149-
"""
150+
""" # noqa: D301
150151
args: MoleculeArgs = ctx.obj.get("args")
151152
subcommand = base._get_subcommand(__name__) # noqa: SLF001
152153
command_args: CommandArgs = {

src/molecule/command/init/scenario.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,14 @@ def scenario(
195195
196196
If name is not specified the 'default' value will be used.
197197
198+
\f
198199
Args:
199200
ctx: Click context object holding commandline arguments.
200201
dependency_name: Name of dependency to initialize.
201202
driver_name: Name of driver to use.
202203
provisioner_name: Name of provisioner to use.
203204
scenario_name: Name of scenario to initialize.
204-
"""
205+
""" # noqa: D301
205206
command_args: CommandArgs = {
206207
"dependency_name": dependency_name,
207208
"driver_name": driver_name,

src/molecule/command/list.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,12 @@ def list_(
8080
) -> None: # pragma: no cover
8181
"""List status of instances.
8282
83+
\f
8384
Args:
8485
ctx: Click context object holding commandline arguments.
8586
scenario_name: Name of the scenario to target.
8687
format: Output format type.
87-
"""
88+
""" # noqa: D301
8889
args: MoleculeArgs = ctx.obj.get("args")
8990
subcommand = base._get_subcommand(__name__) # noqa: SLF001
9091
command_args: CommandArgs = {"subcommand": subcommand, "format": format}

0 commit comments

Comments
 (0)