Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AAriam committed Oct 24, 2023
1 parent 88cabdf commit 321f5db
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/repodynamics/actions/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand Down
4 changes: 2 additions & 2 deletions src/repodynamics/commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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<typ>{"|".join(types)}) # type
(?:\((?P<scope>[^\)\n]+)\))? # optional scope within parentheses
Expand All @@ -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<key>\w+)(: | )(?P<value>.+)$", footer)
match = re.match(r"^(?P<key>[\w-]+)(: | )(?P<value>.+)$", footer)
if match:
footer_list = parsed_footers.setdefault(match.group("key"), [])
footer_list.append(match.group("value"))
Expand Down

0 comments on commit 321f5db

Please sign in to comment.