Skip to content

Commit f8be5bc

Browse files
committed
fix: ty choice formatting
1 parent 2a262ef commit f8be5bc

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ repos:
3333
rev: 0.9.18
3434
hooks:
3535
- id: uv-lock
36+
args: [--check, --no-build]
3637
- repo: https://github.com/executablebooks/mdformat
3738
rev: 1.0.0
3839
hooks:

src/_pytask/click.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,8 @@ def _print_options(group_or_command: Command | DefaultGroup, ctx: Context) -> No
256256
if param.metavar:
257257
opt2 += Text(f" {param.metavar}", style="metavar")
258258
elif isinstance(param.type, click.Choice):
259-
choices = "[" + "|".join(map(str, param.type.choices)) + "]"
259+
choices_values = cast("Sequence[Any]", param.type.choices)
260+
choices = "[" + "|".join(str(choice) for choice in choices_values) + "]"
260261
opt2 += Text(f" {choices}", style="metavar", overflow="fold")
261262

262263
help_text = _format_help_text(param, ctx)

0 commit comments

Comments
 (0)