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

Function report_parse_error

mypy/parse.py:105–117  ·  view source on GitHub ↗
(error: ParseError, errors: Errors)

Source from the content-addressed store, hash-verified

103
104
105def report_parse_error(error: ParseError, errors: Errors) -> None:
106 message = error["message"]
107 # Standardize error message by capitalizing the first word
108 message = re.sub(r"^(\s*\w)", lambda m: m.group(1).upper(), message)
109 # Respect blocker status from error, default to True for syntax errors
110 is_blocker = error.get("blocker", True)
111 error_code = error.get("code")
112 if error_code is None:
113 error_code = codes.SYNTAX
114 else:
115 # Fallback to [syntax] for backwards compatibility.
116 error_code = codes.error_codes.get(error_code) or codes.SYNTAX
117 errors.report(error["line"], error["column"], message, blocker=is_blocker, code=error_code)

Callers 1

load_from_rawFunction · 0.85

Calls 4

upperMethod · 0.80
groupMethod · 0.80
getMethod · 0.45
reportMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…