Skip to content

Commit 8597026

Browse files
committed
Allow prefix characters in versionfile regex
1 parent 5d97fdd commit 8597026

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

77
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
88

9+
## Unreleased
10+
11+
### Changed
12+
13+
- Update version file regex to allow leading characters, like `Plugin-Version`
14+
915
## [1.1.0] - 2025-02-10
1016

1117
### Fixed
1218

13-
- Added `import mdformat.renderer` to fix issue with mdformat v0.7.22
19+
- Add `import mdformat.renderer` to fix issue with mdformat v0.7.22
1420

1521
## [1.0.3] - 2024-11-01
1622

bumpchanges/updatefiles.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
(?P<prefix> # Open `prefix` capture group
1616
\s* # Any whitespace
1717
(?P<vquote>['"]?) # `'`, `"`, or nothing (saved as `vquote` group)
18+
(?:\w+?-?)? # Optional word characters and optional literal `-`
1819
(?:__)? # Optional literal `__`
1920
version # Literal `version`
2021
(?:__)? # Optional literal `__`

tests/test_versionfiles.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,16 @@
8484
"""version 90304""",
8585
"""version 2.3.4""",
8686
),
87+
(
88+
# Leading prefix
89+
"""PluginVersion: 0.6.0""",
90+
"""PluginVersion: 2.3.4""",
91+
),
92+
(
93+
# Leading prefix and dash
94+
"""Plugin-Version: 0.6.0""",
95+
"""Plugin-Version: 2.3.4""",
96+
),
8797
]
8898

8999

0 commit comments

Comments
 (0)