callowayproject / bump-my-version

A small command line tool to simplify releasing software by updating all version strings in your source code by the correct increment and optionally commit and tag the changes.
https://callowayproject.github.io/bump-my-version/
MIT License
305 stars 19 forks source link

Fix KeyError in TOML file handling #213

Closed coordt closed 2 months ago

coordt commented 2 months ago

The code has been updated to handle KeyErrors when updating TOML files. If a KeyError is raised, it's now caught and managed depending on the file_change attributes 'ignore_missing_file' or 'ignore_missing_version'. This aims to provide more robust handling of edge cases in TOML files. In addition, a new test case has been added to ensure current version is not required in the configuration.

Fixes #212

github-actions[bot] commented 2 months ago

Version hint: patch Current version: 0.24.2 New version (when merged): 0.24.3

Comment ID: Display the version hint-auto-generated

github-actions[bot] commented 2 months ago

PR Preview Action v1.4.7 :---: :rocket: Deployed preview to https://callowayproject.github.io/bump-my-version/pr-preview/pr-213/ on branch gh-pages at 2024-07-17 14:18 UTC

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 57.14286% with 3 lines in your changes missing coverage. Please review.

Project coverage is 94.07%. Comparing base (536c7b1) to head (f3c328a). Report is 1 commits behind head on master.

Files Patch % Lines
bumpversion/files.py 57.14% 1 Missing and 2 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #213 +/- ## ========================================== + Coverage 94.06% 94.07% +0.01% ========================================== Files 25 25 Lines 1567 1570 +3 Branches 311 311 ========================================== + Hits 1474 1477 +3 Misses 68 68 Partials 25 25 ``` | [Flag](https://app.codecov.io/gh/callowayproject/bump-my-version/pull/213/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=callowayproject) | Coverage Δ | | |---|---|---| | [python-3.10](https://app.codecov.io/gh/callowayproject/bump-my-version/pull/213/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=callowayproject) | `94.07% <57.14%> (+0.01%)` | :arrow_up: | | [python-3.11](https://app.codecov.io/gh/callowayproject/bump-my-version/pull/213/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=callowayproject) | `94.07% <57.14%> (+0.01%)` | :arrow_up: | | [python-3.8](https://app.codecov.io/gh/callowayproject/bump-my-version/pull/213/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=callowayproject) | `93.98% <42.85%> (-0.06%)` | :arrow_down: | | [python-3.9](https://app.codecov.io/gh/callowayproject/bump-my-version/pull/213/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=callowayproject) | `93.98% <42.85%> (-0.06%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=callowayproject#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.