Skip to content

[pre-commit.ci] pre-commit autoupdate #478

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ repos:
- id: check-docstring-first

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

- repo: https://github.com/woodruffw/zizmor-pre-commit
rev: v1.3.0
rev: v1.5.2
hooks:
- id: zizmor
2 changes: 1 addition & 1 deletion src/cleo/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def get(self, name: str) -> Command:
if self._want_helps:
self._want_helps = False

help_command: HelpCommand = cast(HelpCommand, self.get("help"))
help_command: HelpCommand = cast("HelpCommand", self.get("help"))
help_command.set_command(command)

return help_command
Expand Down
2 changes: 1 addition & 1 deletion src/cleo/commands/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def confirm(
confirmation = ConfirmationQuestion(
question, default=default, true_answer_regex=true_answer_regex
)
return cast(bool, confirmation.ask(self._io))
return cast("bool", confirmation.ask(self._io))

def ask(self, question: str | Question, default: Any | None = None) -> Any:
"""
Expand Down
4 changes: 2 additions & 2 deletions src/cleo/commands/completions_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ def _get_prog_name_from_stack() -> str:
del frame

if f_globals is not None:
package_name = cast(str, f_globals.get("__name__"))
package_name = cast("str", f_globals.get("__name__"))

if package_name == "__main__":
package_name = cast(str, f_globals.get("__package__"))
package_name = cast("str", f_globals.get("__package__"))

if package_name:
package_name = package_name.partition(".")[0]
Expand Down
14 changes: 7 additions & 7 deletions src/cleo/io/buffered_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,23 @@ def __init__(
)

def fetch_output(self) -> str:
return cast(BufferedOutput, self._output).fetch()
return cast("BufferedOutput", self._output).fetch()

def fetch_error(self) -> str:
return cast(BufferedOutput, self._error_output).fetch()
return cast("BufferedOutput", self._error_output).fetch()

def clear(self) -> None:
cast(BufferedOutput, self._output).clear()
cast(BufferedOutput, self._error_output).clear()
cast("BufferedOutput", self._output).clear()
cast("BufferedOutput", self._error_output).clear()

def clear_output(self) -> None:
cast(BufferedOutput, self._output).clear()
cast("BufferedOutput", self._output).clear()

def clear_error(self) -> None:
cast(BufferedOutput, self._error_output).clear()
cast("BufferedOutput", self._error_output).clear()

def supports_utf8(self) -> bool:
return cast(BufferedOutput, self._output).supports_utf8()
return cast("BufferedOutput", self._output).supports_utf8()

def clear_user_input(self) -> None:
self._input.stream.truncate(0)
Expand Down
2 changes: 1 addition & 1 deletion src/cleo/io/outputs/stream_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def _has_color_support(self) -> bool:
return True

return cast(
bool,
"bool",
kernel32.SetConsoleMode(
h, mode.value | self.ENABLE_VIRTUAL_TERMINAL_PROCESSING
)
Expand Down
2 changes: 1 addition & 1 deletion src/cleo/ui/progress_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ def _formatter_max(self) -> int:
return self._max

def _formatter_percent(self) -> int:
return int(math.floor(self._percent * 100))
return math.floor(self._percent * 100)

def _build_line(self) -> str:
regex = re.compile(r"(?i)%([a-z\-_]+)(?::([^%]+))?%")
Expand Down
Loading