Skip to content

Commit

Permalink
Fix minor issues and typos
Browse files Browse the repository at this point in the history
  • Loading branch information
alexreg committed May 15, 2022
1 parent 840375b commit 18969f5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cloup/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
)
from .constraints import (
ConstraintMixin,
constraint,
constrained_params,
constraint,
)
from .types import dir_path, file_path, path
6 changes: 3 additions & 3 deletions cloup/_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class Group(SectionMixin, Command, click.Group):
def __init__(self, *args, show_subcommand_aliases: Optional[bool] = None, **kwargs):
super().__init__(*args, **kwargs)
self.show_subcommand_aliases = show_subcommand_aliases
"""Whether to show subcommand aliases. This """
"""Whether to show subcommand aliases."""

self.alias2name: Dict[str, str] = {}
"""Dictionary mapping each alias to a command name."""
Expand All @@ -164,7 +164,7 @@ def add_command(
) -> None:
super().add_command(cmd, name, section, fallback_to_default_section)
name = cast(str, cmd.name) if name is None else name
aliases = getattr(cmd, 'aliases', [])
aliases = getattr(cmd, 'aliases') or []
for alias in aliases:
self.alias2name[alias] = name

Expand Down Expand Up @@ -637,7 +637,7 @@ def group(name=None, *, cls=None, **kwargs):
:param subcommand_metavar:
string used in the command's usage string to indicate the subcommand place.
:param chain:
if this is set to `True` chaining of multiple subcommands is enabled.
if this is set to `True`, chaining of multiple subcommands is enabled.
This restricts the form of commands in that they cannot have optional
arguments but it allows multiple commands to be chained together.
:param params:
Expand Down
4 changes: 2 additions & 2 deletions cloup/constraints/_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def resolve_params(self, cmd: 'ConstraintMixin') -> 'BoundConstraint':


def _constraint_memo(
f, constr: Union[BoundConstraintSpec, BoundConstraintSpec]
f, constr: Union[BoundConstraintSpec, 'BoundConstraint']
) -> None:
if not hasattr(f, '__constraints'):
f.__constraints = []
Expand Down Expand Up @@ -73,7 +73,7 @@ def constrained_params(
- using a long conditional/composite constraint as decorator may be less
readable.
In these cases, you may consider use ``@constraint_params``.
In these cases, you may consider using ``@constrained_params``.
.. versionadded:: 0.9.0
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/aliases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ parameter exposed by Cloup command decorators.
# Aliases works even if cls is not a Cloup command class
@cli.command(aliases=['uni', 'rm'], cls=click.Command)
@cloup.argument('pkg')
def uninstall(pgk: str):
def uninstall(pkg: str):
"""Uninstall a package."""
print('uninstall', pkg)
Expand Down

0 comments on commit 18969f5

Please sign in to comment.