Skip to content

Commit 5f25300

Browse files
committed
Refactor version parsing in visualize function
Simplify the version parsing process by utilizing the raise_error parameter in the parse method, removing the need for a separate error check. This change ensures that parsing errors are immediately raised and handled cleanly within the visualize function.
1 parent 5b90817 commit 5f25300

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

bumpversion/visualize.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,7 @@ def filter_version_parts(config: Config) -> List[str]:
110110

111111
def visualize(config: Config, version_str: str, box_style: str = "light") -> None:
112112
"""Output a visualization of the bump-my-version bump process."""
113-
version = config.version_config.parse(version_str)
114-
if version is None:
115-
raise BumpVersionError(f"Unable to parse version {version_str}")
113+
version = config.version_config.parse(version_str, raise_error=True)
116114
version_parts = filter_version_parts(config)
117115
num_parts = len(version_parts)
118116

0 commit comments

Comments
 (0)