Skip to content

Commit dd1efa5

Browse files
committed
Add support for 'moveable_tags' configuration option
This update introduces a new 'moveable_tags' field in the configuration model, with appropriate defaults. Test fixture files have been updated to reflect this change. This allows better handling of tags that can be relocated during versioning operations.
1 parent 2b420b8 commit dd1efa5

File tree

4 files changed

+5
-0
lines changed

4 files changed

+5
-0
lines changed

bumpversion/config/models.py

+1
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ class Config(BaseSettings):
9999
commit_args: Optional[str]
100100
scm_info: Optional["SCMInfo"]
101101
parts: Dict[str, VersionComponentSpec]
102+
moveable_tags: list[str] = Field(default_factory=list)
102103
files: List[FileChange] = Field(default_factory=list)
103104
setup_hooks: List[str] = Field(default_factory=list)
104105
pre_commit_hooks: List[str] = Field(default_factory=list)

tests/fixtures/basic_cfg_expected.txt

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
'ignore_missing_version': False,
5050
'included_paths': [],
5151
'message': 'Bump version: {current_version} → {new_version}',
52+
'moveable_tags': [],
5253
'parse': '(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)(\\-(?P<release>[a-z]+))?',
5354
'parts': {'major': {'always_increment': False,
5455
'calver_format': None,

tests/fixtures/basic_cfg_expected.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ ignore_missing_version: false
7070
included_paths:
7171

7272
message: "Bump version: {current_version} → {new_version}"
73+
moveable_tags:
74+
7375
parse: "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)(\\-(?P<release>[a-z]+))?"
7476
parts:
7577
major:

tests/fixtures/basic_cfg_expected_full.json

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
"ignore_missing_version": false,
8080
"included_paths": [],
8181
"message": "Bump version: {current_version} \u2192 {new_version}",
82+
"moveable_tags": [],
8283
"parse": "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)(\\-(?P<release>[a-z]+))?",
8384
"parts": {
8485
"major": {

0 commit comments

Comments
 (0)