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 Feb 4, 2025
1 parent a83347e commit 165b196
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/cleo/descriptors/text_descriptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,6 @@ def _get_column_width(self, commands: Sequence[Command | str]) -> int:

def _get_command_aliases_text(self, command: Command) -> str:
if aliases := command.aliases:
return f"[{ '|'.join(aliases) }] "
return f"[{'|'.join(aliases)}] "

return ""
3 changes: 1 addition & 2 deletions src/cleo/io/inputs/argv_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,7 @@ def _parse_argument(self, token: str) -> None:
message = f"Too many arguments, expected arguments {all_names}"
elif command_name:
message = (
f'No arguments expected for "{command_name}" command, '
f'got "{token}"'
f'No arguments expected for "{command_name}" command, got "{token}"'
)
else:
message = f'No arguments expected, got "{token}"'
Expand Down
2 changes: 1 addition & 1 deletion src/cleo/ui/confirmation_question.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __init__(
def _write_prompt(self, io: IO) -> None:
message = (
f"<question>{self._question} (yes/no)</> "
f'[<comment>{"yes" if self._default else "no"}</>] '
f"[<comment>{'yes' if self._default else 'no'}</>] "
)

io.write_error(message)
Expand Down
18 changes: 1 addition & 17 deletions tests/ui/test_choice_question.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,7 @@


def test_ask_choice(io: BufferedIO) -> None:
io.set_user_input(
"\n"
"1\n"
" 1 \n"
"John\n"
"1\n"
"\n"
"John\n"
"1\n"
"0,2\n"
" 0 , 2 \n"
"\n"
"\n"
"4\n"
"0\n"
"-2\n"
)
io.set_user_input("\n1\n 1 \nJohn\n1\n\nJohn\n1\n0,2\n 0 , 2 \n\n\n4\n0\n-2\n")

heroes = ["Superman", "Batman", "Spiderman"]
question = ChoiceQuestion("What is your favorite superhero?", heroes, "2")
Expand Down

0 comments on commit 165b196

Please sign in to comment.