Skip to content

Commit

Permalink
First strip, then filter assigned topics
Browse files Browse the repository at this point in the history
It was possible to get empty strings as topics.
  • Loading branch information
bswck committed Feb 2, 2024
1 parent 4397d10 commit 24b1401
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jaraco/develop/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ def parse(cls, line):
match = types.SimpleNamespace(**cls.pattern.match(line).groupdict())
tags = list(re.findall(r'\[(.*?)\]', rest := match.rest.rstrip()))
topics_assigned = re.match(r'[^\(\)]*\((.+)\)$', rest)
topics = topics_assigned and filter(None, topics_assigned.group(1).split(','))
return cls(match.name, tags=tags, topics=list(map(str.strip, topics or ())))
topics = topics_assigned and map(str.strip, topics_assigned.group(1).split(','))
return cls(match.name, tags=tags, topics=list(filter(None, topics or ())))

@property
def rtd_slug(self):
Expand Down

0 comments on commit 24b1401

Please sign in to comment.