diff --git a/pyproject.toml b/pyproject.toml index bf796983..7ba56ad9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,7 @@ namespaces = true # ----------------------------------------- Project Metadata ------------------------------------- # [project] -version = "0.0.0.dev158" +version = "0.0.0.dev159" name = "RepoDynamics" dependencies = [ "packaging >= 23.2, < 24", diff --git a/src/repodynamics/actions/init.py b/src/repodynamics/actions/init.py index 2fc8b868..8ec53515 100644 --- a/src/repodynamics/actions/init.py +++ b/src/repodynamics/actions/init.py @@ -1147,7 +1147,7 @@ def get_commits(self) -> list[Commit]: # ) commits = self.git.get_commits(f"{self.hash_before}..{self.hash_after}") self.logger.success("Read commits from git history", json.dumps(commits, indent=4)) - parser = CommitParser(types=self.meta.manager.get_all_conventional_commit_types()) + parser = CommitParser(types=self.meta.manager.get_all_conventional_commit_types(), logger=self.logger) parsed_commits = [] for commit in commits: conv_msg = parser.parse(msg=commit["msg"]) diff --git a/src/repodynamics/commit.py b/src/repodynamics/commit.py index 4394b8c5..bf737746 100644 --- a/src/repodynamics/commit.py +++ b/src/repodynamics/commit.py @@ -7,7 +7,7 @@ class CommitParser: def __init__(self, types: list[str], logger: Logger = None): self._types = types - self._logger = logger + self._logger = logger or Logger() pattern = rf""" ^(?P{"|".join(types)}) # type (?:\((?P[^\)\n]+)\))? # optional scope within parentheses @@ -32,7 +32,7 @@ def parse(self, msg: str) -> CommitMsg | None: parsed_footers = {} footers = commit_parts["footer"].strip().splitlines() for footer in footers: - match = re.match(r"^(?P\w+)(: | )(?P.+)$", footer) + match = re.match(r"^(?P[\w-]+)(: | )(?P.+)$", footer) if match: footer_list = parsed_footers.setdefault(match.group("key"), []) footer_list.append(match.group("value"))