file_content_after = file_content_before.replace(
search_for, replace_with
)
if file_content_before == file_content_after:
# TODO expose this to be configurable
file_content_after = file_content_before.replace(
current_version.original,
replace_with,
)
I believe it should replace the unformatted with the unformatted, not the unformatted with the formatted.
if file_content_before == file_content_after:
# TODO expose this to be configurable
file_content_after = file_content_before.replace(
current_version.original,
new_version.original,
)
So:
if file_content_before == file_content_after:
# TODO expose this to be configurable
file_content_after = file_content_before.replace(
current_version.original,
- replace_with,
+ new_version.original,
)
https://github.com/peritus/bumpversion/blob/6ec908f018a827bfae94ed50baf241461eba7bcb/bumpversion/__init__.py#L250
I believe it should replace the unformatted with the unformatted, not the unformatted with the formatted.
So: