Parse the existing committer table from the markdown content.
(content: str)
| 96 | |
| 97 | |
| 98 | def parse_existing_table(content: str) -> List[Committer]: |
| 99 | """Parse the existing committer table from the markdown content.""" |
| 100 | committers = [] |
| 101 | |
| 102 | # Find the table between the markers |
| 103 | start_marker = "<!-- Begin Auto-Generated Committer List -->" |
| 104 | end_marker = "<!-- End Auto-Generated Committer List -->" |
| 105 | |
| 106 | start_idx = content.find(start_marker) |
| 107 | end_idx = content.find(end_marker) |
| 108 | |
| 109 | if start_idx == -1 or end_idx == -1: |
| 110 | return committers |
| 111 | |
| 112 | table_content = content[start_idx:end_idx] |
| 113 | |
| 114 | # Parse table rows (skip header and separator) |
| 115 | lines = table_content.split('\n') |
| 116 | for line in lines: |
| 117 | line = line.strip() |
| 118 | if line.startswith('|') and '---' not in line and line.count('|') >= 4: |
| 119 | # Split by | and clean up |
| 120 | parts = [part.strip() for part in line.split('|')] |
| 121 | if len(parts) >= 5: |
| 122 | name = parts[1].strip() |
| 123 | apache = parts[2].strip() |
| 124 | github = parts[3].strip() |
| 125 | affiliation = parts[4].strip() |
| 126 | role = parts[5].strip() |
| 127 | |
| 128 | if name and name != 'Name' and (not '-----' in name): |
| 129 | committers.append(Committer(name, apache, github, affiliation, role)) |
| 130 | |
| 131 | return committers |
| 132 | |
| 133 | |
| 134 | def generate_table_row(committer: Committer) -> str: |
no test coverage detected
searching dependent graphs…