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

Method _check_S022

tools/flake8_plugin.py:925–933  ·  view source on GitHub ↗
(self, node: ast.FunctionDef | ast.AsyncFunctionDef)

Source from the content-addressed store, hash-verified

923 )
924
925 def _check_S022(self, node: ast.FunctionDef | ast.AsyncFunctionDef) -> None:
926 if not self._publish_status or node.name not in HTTP_METHODS:
927 return
928 if self._publish_status.get(node.name.upper()) not in PUBLISHED_STATUSES:
929 return
930 if node.returns is None:
931 self.errors.append((node.lineno, node.col_offset, S022_missing_msg))
932 elif _annotation_has_bare_response(node.returns):
933 self.errors.append((node.lineno, node.col_offset, S022_bare_msg))
934
935 def _check_S023(self, node: ast.ClassDef) -> None:
936 for dec in node.decorator_list:

Callers 2

visit_FunctionDefMethod · 0.95

Calls 3

getMethod · 0.65
appendMethod · 0.65

Tested by

no test coverage detected