with_returns checks if docstring comments what are returned . Args: node (astroid.node): the node is visiting. doc (Docstring): Docstring object. Returns: True if successful otherwise False.
(self, node, doc)
| 283 | return True |
| 284 | |
| 285 | def with_returns(self, node, doc): |
| 286 | """with_returns checks if docstring comments what are returned . |
| 287 | Args: |
| 288 | node (astroid.node): the node is visiting. |
| 289 | doc (Docstring): Docstring object. |
| 290 | Returns: |
| 291 | True if successful otherwise False. |
| 292 | """ |
| 293 | |
| 294 | if node.name.startswith("__") or node.name.startswith("_"): |
| 295 | return True |
| 296 | find = False |
| 297 | for t in node.body: |
| 298 | if not isinstance(t, astroid.Return): |
| 299 | continue |
| 300 | |
| 301 | find = True |
| 302 | break |
| 303 | |
| 304 | if not find: |
| 305 | return True |
| 306 | |
| 307 | if len(doc.get_returns()) == 0: |
| 308 | self.add_message('W9007', node=node, line=node.fromlineno) |
| 309 | return False |
| 310 | |
| 311 | return True |
| 312 | |
| 313 | def all_args_in_doc(self, node, doc): |
| 314 | """all_args_in_doc checks if arguments are mentioned in doc |
no test coverage detected