Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#475)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Branch Vincent <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and branchvincent authored Feb 8, 2025
1 parent dacd517 commit 108303f
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 26 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/downstream.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
# push:
# branches: [main]

permissions: {}

jobs:
tests:
name: ${{ matrix.ref }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/news.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
pull_request:
types: [labeled, unlabeled, opened, reopened, synchronize]

permissions: {}

jobs:
check-news-entry:
name: news entry
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
release:
types: [published]

permissions: {}

jobs:
build:
name: Build
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
env:
PYTHONWARNDEFAULTENCODING: true

permissions: {}

jobs:
Tests:
name: ${{ matrix.os }} / ${{ matrix.python-version }}
Expand Down
7 changes: 2 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,12 @@ repos:
- id: check-docstring-first

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
rev: v0.9.5
hooks:
- id: ruff
- id: ruff-format

- repo: https://github.com/woodruffw/zizmor-pre-commit
rev: v1.0.0
rev: v1.3.0
hooks:
- id: zizmor
# types and files can be removed with https://github.com/woodruffw/zizmor-pre-commit/pull/2
types: [yaml]
files: \.github/workflows/.*$
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 108303f

Please sign in to comment.