-
-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Global regex
configuration not inherited in sub-sections
#64
Comments
While we wait for callowayproject/bump-my-version#64
@kdeldycke Could you test this with version 0.12? |
@coordt bump-my-version 0.12.0 does not fix this issue. Here is the proof: Test caseA
And given a [tool.bumpversion]
current_version = "4.7.1"
regex = true
[[tool.bumpversion.files]]
filename = "./citation.cff"
search = "date-released: \\d{{4}}-\\d{{2}}-\\d{{2}}"
replace = "date-released: {utcnow:%Y-%m-%d}" The last sub-section does not inherits the
SolutionNow if we explicitely set the [tool.bumpversion]
current_version = "4.7.1"
regex = true
[[tool.bumpversion.files]]
filename = "./citation.cff"
regex = true
search = "date-released: \\d{{4}}-\\d{{2}}-\\d{{2}}"
replace = "date-released: {utcnow:%Y-%m-%d}" The same command works as expected:
|
no_regex
configuration not inherited in sub-sectionsregex
configuration not inherited in sub-sections
Fixes #64 The default value of False was overriding other values.
@kdeldycke Do you have time to double check this PR? I re-created your test, so I'm pretty confident it is fixed. Otherwise I'll merge it in tomorrow. |
Description
The
no_regex
parameter from the top-level section of a configuration file is not inherited in sub-sections.What I Did
Here is a
changelog.md
file containing:With a
pyproject.toml
file containing:Invoking the CLI, I get:
Here you can see the
./changelog.md
file is left untouched. But I expect instead to have its version updated.Solution
To fix this behaviour, I had to duplicate the
no_regex = true
parameter from the top-level[tool.bumpversion]
section to the[[tool.bumpversion.files]]
.So with the following
pyproject.toml
file:I now get the behavior I was looking for:
Discussion
This demonstrate that I was expecting the
no_regex
parameter from the top-level to be inherited by default in the sub-sections.I think this is the behavior that should be implemented. In the same vein as #59 (in which we discuss defaulting to
no-regex
mode), I think this behavior will reduce surprises for newcomers, make configuration files more readable, and increase the overall user-friendlyness of bump-my-version.The text was updated successfully, but these errors were encountered: