From c6a7347e73456265ab51abd776d992c3a7e12524 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 11:28:37 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20[pre-commit.ci]=20Auto=20format?= =?UTF-8?q?=20from=20pre-commit.com=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typer/cli.py | 2 +- typer/core.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/typer/cli.py b/typer/cli.py index aa6bc100d9..087efef625 100644 --- a/typer/cli.py +++ b/typer/cli.py @@ -305,7 +305,7 @@ def docs( if not hasattr(ctx, "obj") or ctx.obj is None: ctx.ensure_object(dict) if isinstance(ctx.obj, dict): - ctx.obj['TYPER_RICH_MARKUP_MODE'] = typer_obj.rich_markup_mode + ctx.obj["TYPER_RICH_MARKUP_MODE"] = typer_obj.rich_markup_mode click_obj = typer.main.get_command(typer_obj) docs = get_docs_for_click(obj=click_obj, ctx=ctx, name=name, title=title) clean_docs = f"{docs.strip()}\n" diff --git a/typer/core.py b/typer/core.py index 227e882940..39b55d2684 100644 --- a/typer/core.py +++ b/typer/core.py @@ -373,7 +373,7 @@ def get_help_record(self, ctx: click.Context) -> Optional[Tuple[str, str]]: extra_str = f"[{extra_str}]" rich_markup_mode = None if hasattr(ctx, "obj") and isinstance(ctx.obj, dict): - rich_markup_mode = ctx.obj.get('TYPER_RICH_MARKUP_MODE', None) + rich_markup_mode = ctx.obj.get("TYPER_RICH_MARKUP_MODE", None) if rich is not None and rich_markup_mode == "rich": # This is needed for when we want to export to HTML extra_str = rich.markup.escape(extra_str).strip() @@ -571,7 +571,7 @@ def _write_opts(opts: Sequence[str]) -> str: rich_markup_mode = None if hasattr(ctx, "obj") and isinstance(ctx.obj, dict): - rich_markup_mode = ctx.obj.get('TYPER_RICH_MARKUP_MODE', None) + rich_markup_mode = ctx.obj.get("TYPER_RICH_MARKUP_MODE", None) if rich is not None and rich_markup_mode == "rich": # This is needed for when we want to export to HTML extra_str = rich.markup.escape(extra_str).strip() @@ -700,7 +700,7 @@ def format_help(self, ctx: click.Context, formatter: click.HelpFormatter) -> Non if not hasattr(ctx, "obj") or ctx.obj is None: ctx.ensure_object(dict) if isinstance(ctx.obj, dict): - ctx.obj['TYPER_RICH_MARKUP_MODE'] = self.rich_markup_mode + ctx.obj["TYPER_RICH_MARKUP_MODE"] = self.rich_markup_mode return super().format_help(ctx, formatter) return rich_utils.rich_format_help( obj=self,