Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#683)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/psf/black: 24.10.0 → 25.1.0](psf/black@24.10.0...25.1.0)
- [github.com/PyCQA/isort: 5.13.2 → 6.0.0](PyCQA/isort@5.13.2...6.0.0)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Feb 4, 2025
1 parent 6a5f33c commit cd0d2df
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 32 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ci:

repos:
- repo: https://github.com/psf/black
rev: 24.10.0
rev: 25.1.0
hooks:
- id: black

Expand All @@ -15,7 +15,7 @@ repos:
args: [--py38-plus]

- repo: https://github.com/PyCQA/isort
rev: 5.13.2
rev: 6.0.0
hooks:
- id: isort
additional_dependencies: [toml]
Expand Down
60 changes: 30 additions & 30 deletions src/towncrier/click_default_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,48 +8,48 @@
# the project looks unmaintaintained.

"""
click_default_group
~~~~~~~~~~~~~~~~~~~
click_default_group
~~~~~~~~~~~~~~~~~~~
Define a default subcommand by `default=True`:
Define a default subcommand by `default=True`:
.. sourcecode:: python
.. sourcecode:: python
import click
from click_default_group import DefaultGroup
import click
from click_default_group import DefaultGroup
@click.group(cls=DefaultGroup, default_if_no_args=True)
def cli():
pass
@click.group(cls=DefaultGroup, default_if_no_args=True)
def cli():
pass
@cli.command(default=True)
def foo():
click.echo('foo')
@cli.command(default=True)
def foo():
click.echo('foo')
@cli.command()
def bar():
click.echo('bar')
@cli.command()
def bar():
click.echo('bar')
Then you can invoke that without explicit subcommand name:
Then you can invoke that without explicit subcommand name:
.. sourcecode:: console
.. sourcecode:: console
$ cli.py --help
Usage: cli.py [OPTIONS] COMMAND [ARGS]...
$ cli.py --help
Usage: cli.py [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Options:
--help Show this message and exit.
Command:
foo*
bar
Command:
foo*
bar
$ cli.py
foo
$ cli.py foo
foo
$ cli.py bar
bar
$ cli.py
foo
$ cli.py foo
foo
$ cli.py bar
bar
"""
import warnings
Expand Down

0 comments on commit cd0d2df

Please sign in to comment.