MCPcopy Index your code
hub / github.com/python/mypy / get_mypy_comments

Function get_mypy_comments

mypy/util.py:230–241  ·  view source on GitHub ↗
(source: str)

Source from the content-addressed store, hash-verified

228
229
230def 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
244JUNIT_HEADER_TEMPLATE: Final = """<?xml version="1.0" encoding="utf-8"?>

Callers 3

test_parserFunction · 0.90
test_parserFunction · 0.90

Calls 5

enumerateFunction · 0.85
lenFunction · 0.85
splitMethod · 0.80
appendMethod · 0.80
startswithMethod · 0.45

Tested by 2

test_parserFunction · 0.72
test_parserFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…