-
-
Notifications
You must be signed in to change notification settings - Fork 302
fix(bump): Search for version number line by line #568
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
Conversation
514d19a
to
38907bc
Compare
Avoid the complexities of multiline regex matching and inconsistencies with the case where no regex is specified. Simplify the implementation by eliminating the need to track an offset into the file. Ensure that the version number will be found even if it is to the left of the portion of the line matching the regex.
Commitizen runs bump on itself to, among other things, manage the version it uses of its own pre-commit hooks. When searching .pre-commit-config.yaml for the version number of Commitizen, we search for "Commitizen," which is in a comment to the right of the version number. Remove the lookahead assertion for "Commitizen," and instead simply consume it when matching now that version_files regexes don't need to exclusively match to the left of the version number.
38907bc
to
7f7a606
Compare
Codecov ReportBase: 98.43% // Head: 98.43% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@ ## master #568 +/- ## ========================================== - Coverage 98.43% 98.43% -0.01% ========================================== Files 39 39 Lines 1602 1596 -6 ========================================== - Hits 1577 1571 -6 Misses 25 25
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
LGTM! @Lee-W feel free to merge
Uh oh!
There was an error while loading. Please reload this page.
Description
Fixes #498.
Add mypy typing for
_bump_with_regex
.Avoid the complexities of multiline regex matching and inconsistencies with the case where no regex is specified. Simplify the implementation by eliminating the need to track an offset into the file. Ensure that the version number will be found even if it is to the left of the portion of the line matching the regex.
Remove lookahead assertion from
version_files
entry for.pre-commit-config.yaml
. Commitizen runs bump on itself to, among other things, manage the version it uses of its own pre-commit hooks. When searching.pre-commit-config.yaml
for the version number of Commitizen, we search for "Commitizen," which is in a comment to the right of the version number. Remove the lookahead assertion for "Commitizen," and instead simply consume it when matching now thatversion_files
regexes don't need to exclusively match to the left of the version number.Checklist
./scripts/format
and./scripts/test
locally to ensure this change passes linter check and testExpected behavior
The version of Commitizen is bumped as usual in all
version_files
listed inpyproject.toml
.Steps to Test This Pull Request
cz bump
.Additional context
As mentioned in #565, I am encountering some difficulties testing Commitizen locally.