From f5b1452c9c4a52cf87989eb23dc3773868d3abcd Mon Sep 17 00:00:00 2001 From: Yu-Ting Hsiung Date: Mon, 15 Sep 2025 19:44:16 +0800 Subject: [PATCH] refactor(BaseCommitizen): construct Style object directly to get rid of potential type error --- commitizen/cz/base.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/commitizen/cz/base.py b/commitizen/cz/base.py index cdc147669..75981f074 100644 --- a/commitizen/cz/base.py +++ b/commitizen/cz/base.py @@ -5,7 +5,7 @@ from typing import Any, Callable, Protocol from jinja2 import BaseLoader, PackageLoader -from prompt_toolkit.styles import Style, merge_styles +from prompt_toolkit.styles import Style from commitizen import git from commitizen.config.base_config import BaseConfig @@ -77,12 +77,12 @@ def message(self, answers: Mapping[str, Any]) -> str: @property def style(self) -> Style: - return merge_styles( + return Style( [ - Style(BaseCommitizen.default_style_config), - Style(self.config.settings["style"]), + *BaseCommitizen.default_style_config, + *self.config.settings["style"], ] - ) # type: ignore[return-value] + ) def example(self) -> str: """Example of the commit message."""