Parse a single changelog entry line. Format: [ISSUE-ID: ]description (author1) (author2) ...
(text: str)
| 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('<', '<').replace('>', '>') |
| 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 | |
| 1132 | def main(): |
no test coverage detected