Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jun 6, 2024
1 parent 294ba7f commit 6e4ed5c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/aiida/cmdline/groups/verdi.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ def __init__(self, *args, **kwargs):

class VerdiCommand(click.Command):
"""Custom command implementation to customize the logic of printing deprecation messages.
If a command is deprecated, the :class:`click.Command` adds a deprecation marker in the short help and the full
help text, and prints a deprecation warning when the command is invoked. The problem is that the deprecation warning
is printed after the prompting for parameters, which for interactive commands mean the deprecation warning comes too
late, when the user has already provided all prompts.
Here, the :meth:`click.Command.parse_args` method is overridden, which is called before the interactive options
start to prompt, such that the deprecation warning can be printed. The :meth:`click.Command.invoke` method is also
overridden in order to skip the printing of the deprecation message handled by ``click`` as that would result in
Expand Down

0 comments on commit 6e4ed5c

Please sign in to comment.