(source: str)
| 228 | |
| 229 | |
| 230 | def get_mypy_comments(source: str) -> list[tuple[int, str]]: |
| 231 | PREFIX = "# mypy: " |
| 232 | # Don't bother splitting up the lines unless we know it is useful |
| 233 | if PREFIX not in source: |
| 234 | return [] |
| 235 | lines = source.split("\n") |
| 236 | results = [] |
| 237 | for i, line in enumerate(lines): |
| 238 | if line.startswith(PREFIX): |
| 239 | results.append((i + 1, line[len(PREFIX) :])) |
| 240 | |
| 241 | return results |
| 242 | |
| 243 | |
| 244 | JUNIT_HEADER_TEMPLATE: Final = """<?xml version="1.0" encoding="utf-8"?> |
searching dependent graphs…