Skip to content

Commit b8d5272

Browse files
[pre-commit.ci] pre-commit autoupdate (#478)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent f1fd40d commit b8d5272

File tree

7 files changed

+15
-15
lines changed

7 files changed

+15
-15
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ repos:
2222
- id: check-docstring-first
2323

2424
- repo: https://github.com/astral-sh/ruff-pre-commit
25-
rev: v0.9.5
25+
rev: v0.11.8
2626
hooks:
2727
- id: ruff
2828
- id: ruff-format
2929

3030
- repo: https://github.com/woodruffw/zizmor-pre-commit
31-
rev: v1.3.0
31+
rev: v1.6.0
3232
hooks:
3333
- id: zizmor

src/cleo/application.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def get(self, name: str) -> Command:
201201
if self._want_helps:
202202
self._want_helps = False
203203

204-
help_command: HelpCommand = cast(HelpCommand, self.get("help"))
204+
help_command: HelpCommand = cast("HelpCommand", self.get("help"))
205205
help_command.set_command(command)
206206

207207
return help_command

src/cleo/commands/command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def confirm(
219219
confirmation = ConfirmationQuestion(
220220
question, default=default, true_answer_regex=true_answer_regex
221221
)
222-
return cast(bool, confirmation.ask(self._io))
222+
return cast("bool", confirmation.ask(self._io))
223223

224224
def ask(self, question: str | Question, default: Any | None = None) -> Any:
225225
"""

src/cleo/commands/completions_command.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,10 @@ def _get_prog_name_from_stack() -> str:
151151
del frame
152152

153153
if f_globals is not None:
154-
package_name = cast(str, f_globals.get("__name__"))
154+
package_name = cast("str", f_globals.get("__name__"))
155155

156156
if package_name == "__main__":
157-
package_name = cast(str, f_globals.get("__package__"))
157+
package_name = cast("str", f_globals.get("__package__"))
158158

159159
if package_name:
160160
package_name = package_name.partition(".")[0]

src/cleo/io/buffered_io.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,23 @@ def __init__(
2626
)
2727

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

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

3434
def clear(self) -> None:
35-
cast(BufferedOutput, self._output).clear()
36-
cast(BufferedOutput, self._error_output).clear()
35+
cast("BufferedOutput", self._output).clear()
36+
cast("BufferedOutput", self._error_output).clear()
3737

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

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

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

4747
def clear_user_input(self) -> None:
4848
self._input.stream.truncate(0)

src/cleo/io/outputs/stream_output.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def _has_color_support(self) -> bool:
145145
return True
146146

147147
return cast(
148-
bool,
148+
"bool",
149149
kernel32.SetConsoleMode(
150150
h, mode.value | self.ENABLE_VIRTUAL_TERMINAL_PROCESSING
151151
)

src/cleo/ui/progress_bar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ def _formatter_max(self) -> int:
401401
return self._max
402402

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

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

0 commit comments

Comments
 (0)