(parts: list[str])
| 168 | |
| 169 | |
| 170 | def parse_raw_diff_line(parts: list[str]) -> RawDiffLine: |
| 171 | meta = parts[0] |
| 172 | path = parts[1] |
| 173 | dst_path = parts[2] if len(parts) > 2 else None |
| 174 | |
| 175 | m = meta[1:].split(' ') |
| 176 | src_mode, dst_mode, src_sha, dst_sha, status = m |
| 177 | score = None |
| 178 | if len(status) > 1: |
| 179 | score = int(status[1:]) |
| 180 | status = status[0] |
| 181 | |
| 182 | return RawDiffLine( |
| 183 | src_mode=src_mode, |
| 184 | dst_mode=dst_mode, |
| 185 | src_sha=src_sha, |
| 186 | dst_sha=dst_sha, |
| 187 | status=status, |
| 188 | path=path, |
| 189 | score=score, |
| 190 | dst_path=dst_path, |
| 191 | ) |
| 192 | |
| 193 | |
| 194 | def parse_raw_diff(diff: str) -> List[RawDiffLine]: |
no test coverage detected