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

Method _enter_input

tools/flake8_plugin.py:1016–1031  ·  view source on GitHub ↗

Push an accumulator for a PUBLIC HTTP method on an endpoint class.

(self, node: ast.FunctionDef | ast.AsyncFunctionDef)

Source from the content-addressed store, hash-verified

1014 self.generic_visit(node)
1015
1016 def _enter_input(self, node: ast.FunctionDef | ast.AsyncFunctionDef) -> bool:
1017 """Push an accumulator for a PUBLIC HTTP method on an endpoint class."""
1018 if len(self._class_stack) != 1 or self._function_depth != 0:
1019 return False
1020 if not self._publish_status or node.name not in HTTP_METHODS:
1021 return False
1022 if self._publish_status.get(node.name.upper()) != "PUBLIC":
1023 return False
1024 decorators = self._class_decorators + node.decorator_list
1025 self._input_stack.append(
1026 _InputCtx(
1027 _declared_names(decorators, "parameters"),
1028 _declared_names(decorators, "request"),
1029 )
1030 )
1031 return True
1032
1033 def _record_input_call(self, node: ast.Call) -> None:
1034 """A `.get()` read, or the whole dict handed to something else."""

Callers 2

visit_FunctionDefMethod · 0.95

Calls 4

_InputCtxClass · 0.85
_declared_namesFunction · 0.85
getMethod · 0.65
appendMethod · 0.65

Tested by

no test coverage detected