MCPcopy Create free account
hub / github.com/apache/solr / parse_entry_line

Method parse_entry_line

dev-tools/scripts/changes2logchange.py:1090–1129  ·  view source on GitHub ↗

Parse a single changelog entry line. Format: [ISSUE-ID: ]description (author1) (author2) ...

(text: str)

Source from the content-addressed store, hash-verified

1088
1089 @staticmethod
1090 def parse_entry_line(text: str) -> Optional[ChangeEntry]:
1091 """
1092 Parse a single changelog entry line.
1093
1094 Format: [ISSUE-ID: ]description (author1) (author2) ...
1095 """
1096 if not text.strip():
1097 return None
1098
1099 # Extract issue links
1100 links = IssueExtractor.extract_issues(text)
1101
1102 # Remove issue IDs from text
1103 for link in links:
1104 # Remove markdown link format [ID](url)
1105 text = re.sub(rf'\[{re.escape(link.name)}\]\([^)]+\)', '', text)
1106 # Remove plain text issue IDs
1107 text = re.sub(rf'{re.escape(link.name)}\s*:?\s*', '', text)
1108
1109 text = text.strip()
1110
1111 # Extract authors
1112 text, authors = AuthorParser.parse_authors(text)
1113 text = text.strip()
1114
1115 # Escape HTML angle brackets
1116 text = text.replace('<', '&lt;').replace('>', '&gt;')
1117
1118 if not text:
1119 return None
1120
1121 # Default to 'other' type
1122 change_type = 'other'
1123
1124 return ChangeEntry(
1125 title=text,
1126 change_type=change_type,
1127 authors=authors,
1128 links=links,
1129 )
1130
1131
1132def main():

Callers 1

processMethod · 0.80

Calls 7

stripMethod · 0.80
extract_issuesMethod · 0.80
parse_authorsMethod · 0.80
ChangeEntryClass · 0.70
subMethod · 0.45
escapeMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected