Skip to content

Commit

Permalink
Update matrix command
Browse files Browse the repository at this point in the history
  • Loading branch information
Qalthos committed Oct 29, 2024
1 parent 983fbc4 commit a34bd5a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
6 changes: 0 additions & 6 deletions .config/pydoclint-baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ src/molecule/command/init/scenario.py
DOC107: Function `scenario`: The option `--arg-type-hints-in-signature` is `True` but not all args in the signature have type hints
DOC103: Function `scenario`: Docstring arguments are different from function arguments. (Or could be other formatting issues: https://jsh9.github.io/pydoclint/violation_codes.html#notes-on-doc103 ). Arguments in the function signature but not in the docstring: [ctx: , dependency_name: , driver_name: , provisioner_name: , scenario_name: ].
--------------------
src/molecule/command/matrix.py
DOC101: Function `matrix`: Docstring contains fewer arguments than in function signature.
DOC106: Function `matrix`: The option `--arg-type-hints-in-signature` is `True` but there are no argument type hints in the signature
DOC107: Function `matrix`: The option `--arg-type-hints-in-signature` is `True` but not all args in the signature have type hints
DOC103: Function `matrix`: Docstring arguments are different from function arguments. (Or could be other formatting issues: https://jsh9.github.io/pydoclint/violation_codes.html#notes-on-doc103 ). Arguments in the function signature but not in the docstring: [ctx: , scenario_name: , subcommand: ].
--------------------
src/molecule/command/prepare.py
DOC101: Method `Prepare.execute`: Docstring contains fewer arguments than in function signature.
DOC106: Method `Prepare.execute`: The option `--arg-type-hints-in-signature` is `True` but there are no argument type hints in the signature
Expand Down
18 changes: 14 additions & 4 deletions src/molecule/command/matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@


if TYPE_CHECKING:
from molecule.types import CommandArgs
from molecule.types import CommandArgs, MoleculeArgs


LOG = logging.getLogger(__name__)
Expand Down Expand Up @@ -79,9 +79,19 @@ class Matrix(base.Base):
# NOTE(retr0h): Cannot introspect base.Base for `click.Choice`, since
# subclasses have not all loaded at this point.
@click.argument("subcommand", nargs=1, type=click.UNPROCESSED)
def matrix(ctx, scenario_name, subcommand): # type: ignore[no-untyped-def] # pragma: no cover # noqa: ANN001, ANN201
"""List matrix of steps used to test instances."""
args = ctx.obj.get("args")
def matrix(
ctx: click.Context,
scenario_name: str,
subcommand: str,
) -> None: # pragma: no cover
"""List matrix of steps used to test instances.
Args:
ctx: Click context object holding commandline arguments.
scenario_name: Name of the scenario to target.
subcommand: Subcommand to target.
"""
args: MoleculeArgs = ctx.obj.get("args")
command_args: CommandArgs = {"subcommand": subcommand}

s = scenarios.Scenarios(base.get_configs(args, command_args), scenario_name)
Expand Down

0 comments on commit a34bd5a

Please sign in to comment.