MCPcopy Create free account
hub / github.com/getsentry/sentry / _record_validator

Method _record_validator

tools/flake8_plugin.py:1056–1070  ·  view source on GitHub ↗

A serializer built from the query string or the request body.

(self, node: ast.Call)

Source from the content-addressed store, hash-verified

1054 return
1055
1056 def _record_validator(self, node: ast.Call) -> None:
1057 """A serializer built from the query string or the request body."""
1058 ctx = self._input_stack[-1]
1059 for keyword in node.keywords:
1060 if keyword.arg != "data":
1061 continue
1062 # A class, by convention. Skips plain calls taking data=, and
1063 # runtime-chosen classes the schema could not name either.
1064 if not _looks_like_a_class(node.func):
1065 continue
1066 name = _name_of(node.func).rsplit(".", 1)[-1]
1067 if ctx.is_query(keyword.value):
1068 ctx.query_validators.append((node.lineno, node.col_offset, name))
1069 elif ctx.is_body(keyword.value):
1070 ctx.body_validators.append((node.lineno, node.col_offset, name))
1071
1072 def _report_input(self, line: int, col: int, msg: str, rule: str) -> None:
1073 """Fatal only for an enforced rule; otherwise recorded unless asked for."""

Callers 1

visit_CallMethod · 0.95

Calls 5

_looks_like_a_classFunction · 0.85
_name_ofFunction · 0.85
is_queryMethod · 0.80
is_bodyMethod · 0.80
appendMethod · 0.65

Tested by

no test coverage detected