mirror of
https://github.com/TECHNOFAB11/bumpver.git
synced 2025-12-14 23:33:52 +01:00
WIP: refactoring and testing
This commit is contained in:
parent
8189075385
commit
5108837f45
11 changed files with 203 additions and 151 deletions
|
|
@ -85,6 +85,9 @@ MINIMUM_ID = "0"
|
|||
|
||||
def next_id(prev_id: str) -> str:
|
||||
num_digits = len(prev_id)
|
||||
if prev_id.count("9") == num_digits:
|
||||
raise OverflowError("max lexical version reached: " + prev_id)
|
||||
|
||||
_prev_id = int(prev_id, 10)
|
||||
_next_id = int(_prev_id) + 1
|
||||
next_id = f"{_next_id:0{num_digits}}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue