visualize
Visualize the bumpversion process.
Classes¶
Border
dataclass
¶
Border(
corner_bottom_right: str,
corner_top_right: str,
corner_top_left: str,
corner_bottom_left: str,
divider_left: str,
divider_up: str,
divider_down: str,
divider_right: str,
line: str,
pipe: str,
cross: str,
)
A border definition.
Functions¶
connection_str
¶
connection_str(
border: Border,
has_next: bool = False,
has_previous: bool = False,
) -> str
Return the correct connection string based on the next and previous.
Parameters:
border
-
The border definition to draw the lines
TYPE:
Border
has_next
-
If
True
, there is a next lineTYPE:
bool
DEFAULT:
False
has_previous
-
If
True
, there is a previous lineTYPE:
bool
DEFAULT:
False
Returns:
-
str
-
A string that connects left-to-right and top-to-bottom based on the next and previous
filter_version_parts
¶
filter_version_parts(config: Config) -> List[str]
labeled_line
¶
labeled_line(
label: str,
border: Border,
fit_length: Optional[int] = None,
) -> str
lead_string
¶
lead_string(
version_str: str, border: Border, blank: bool = False
) -> str
Return the first part of a string with the bump character or spaces of the correct amount.
Examples:
>>> lead_string("1.0.0", Border(*BOX_CHARS["light"]))
'1.0.0 ── bump ─'
>>> lead_string("1.0.0", Border(*BOX_CHARS["light"]), blank=True)
' '
Parameters:
version_str
-
The string to render as the starting point
TYPE:
str
border
-
The border definition to draw the lines
TYPE:
Border
blank
-
If
True
, return a blank string the same length as the version bump stringTYPE:
bool
DEFAULT:
False
Returns:
-
str
-
The version bump string or a blank string
visualize
¶
visualize(
config: Config,
version_str: str,
box_style: str = "light",
) -> None
Output a visualization of the bump-my-version bump process.