has_period checks if one line doc end-with '.' . Args: node (astroid.node): the node is visiting. Returns: True if successful otherwise False.
(self, node)
| 238 | return True |
| 239 | |
| 240 | def has_period(self, node): |
| 241 | """has_period checks if one line doc end-with '.' . |
| 242 | Args: |
| 243 | node (astroid.node): the node is visiting. |
| 244 | Returns: |
| 245 | True if successful otherwise False. |
| 246 | """ |
| 247 | if node.doc is None: |
| 248 | return True |
| 249 | |
| 250 | if len(node.doc.splitlines()) > 1: |
| 251 | return True |
| 252 | |
| 253 | if not node.doc.strip().endswith('.'): |
| 254 | self.add_message('W9002', node=node, line=node.fromlineno) |
| 255 | return False |
| 256 | |
| 257 | return True |
| 258 | |
| 259 | def with_raises(self, node, doc): |
| 260 | """with_raises checks if one line doc end-with '.' . |