You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some circumstances, while I deactivated regex mode everywhere (both in config file and on CLI invokation), the search string gets interpreted as a regex and has unwanted side-effects.
What I Did
Starting from a changelog.md file containing:
# Changelog## [0.0.1 (unreleased)](https://cool.url)- Test unreleased package.
$ bump-my-version replace --verbose --dry-run --no-regex --no-configured-files --search "(unreleased)" --replace "({now:%Y-%m-%d})" ./changelog.md
Starting BumpVersion 0.9.3
Reading config file pyproject.toml:
Parsing version '0.0.1' using regexp '(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)'
Parsed the following values: major=0, minor=0, patch=1
Asserting files ./changelog.md contain the version string...
Found 're.compile('(unreleased)', re.MULTILINE|re.DOTALL)' in ./changelog.md at line 3: unreleased
Would change file ./changelog.md:
*** before ./changelog.md
--- after ./changelog.md
***************
*** 1,5 ****
# Changelog
! ## [0.0.1 (unreleased)](https://cool.url)
! - Test unreleased package.
--- 1,5 ----
# Changelog
! ## [0.0.1 ((2023-08-29))](https://cool.url)
! - Test (2023-08-29) package.
You can see here how the (unreleased) search string is interpreted as a regex and has unwanted side effect in changelog.md file.
I expect here to have the final result of that file to be:
# Changelog
## [0.0.1 (2023-08-29)](https://cool.url)
- Test unreleased package.
Instead of:
# Changelog
## [0.0.1 ((2023-08-29))](https://cool.url)
- Test (2023-08-29) package.
I have a hard time understanding what's happening.
Maybe there is a difference between in the way strings passed in the CLI are not parsed like those in the config file.
Maybe duplicating the replace action in both the config file and the CLI is messing with some internals.
Or maybe the --no-configured-files is not well-named, as I expect it to ignore the directives from any configuration file found. In which case what I am looking for is probably a --no-config option.
The text was updated successfully, but these errors were encountered:
- Fixes#61
- Config now includes `resolved_filemap` property
- resolved filemap exapands all globs
- Config now includes `files_to_modify` property
- files to modify resolves inclusions and exclutions
- Improved Config.add_files property
Description
In some circumstances, while I deactivated regex mode everywhere (both in config file and on CLI invokation), the search string gets interpreted as a regex and has unwanted side-effects.
What I Did
Starting from a
changelog.md
file containing:With a
pyproject.toml
file alongside containing:Now let's invoke this CLI:
You can see here how the
(unreleased)
search string is interpreted as a regex and has unwanted side effect inchangelog.md
file.I expect here to have the final result of that file to be:
Instead of:
I have a hard time understanding what's happening.
Maybe there is a difference between in the way strings passed in the CLI are not parsed like those in the config file.
Maybe duplicating the replace action in both the config file and the CLI is messing with some internals.
Or maybe the
--no-configured-files
is not well-named, as I expect it to ignore the directives from any configuration file found. In which case what I am looking for is probably a--no-config
option.The text was updated successfully, but these errors were encountered: