From 77c887caf46cdfbd4d53a642a3ab3de5a38c0db9 Mon Sep 17 00:00:00 2001 From: Tyler Jachetta Date: Tue, 5 Jan 2021 10:07:54 -0500 Subject: [PATCH] Relaxing autobump: allow for space after `:` following the Robustness principle, bump: patch seems reasonable There may be good reason to allow for whitespace other places (after `#` and inside `[]`, but those feel less obvious to me (and are not what bit me). --- avakas/flavors/base.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/avakas/flavors/base.py b/avakas/flavors/base.py index 85d466c..d30e790 100644 --- a/avakas/flavors/base.py +++ b/avakas/flavors/base.py @@ -96,8 +96,10 @@ def __determine_bump(self): our version""" self.repo = self.__load_git() vsn = None - reg = re.compile(r'(\#|bump:|\[)(?P(patch|minor|major))(.*|\])', - re.MULTILINE) + reg = re.compile( + r'(\#|bump:\s*|\[)(?P(patch|minor|major))(.*|\])', + re.MULTILINE) + for commit in self.repo.iter_commits(self.options['branch']): # we go iterate back to the last time we bumped the version if commit.message.startswith('Version bumped to'):