Pylint plugin to check that relative imports are used (#50937)
* Pylint plugin to check that relative imports are used * Fix existing sites * Update description message * Fix typo
This commit is contained in:
parent
b704f0e729
commit
016abda12e
11 changed files with 89 additions and 44 deletions
|
@ -1,5 +1,5 @@
|
|||
"""Plugin for constructor definitions."""
|
||||
from astroid import ClassDef, Const, FunctionDef
|
||||
from astroid import Const, FunctionDef
|
||||
from pylint.checkers import BaseChecker
|
||||
from pylint.interfaces import IAstroidChecker
|
||||
from pylint.lint import PyLinter
|
||||
|
@ -43,7 +43,7 @@ class HassConstructorFormatChecker(BaseChecker): # type: ignore[misc]
|
|||
return
|
||||
|
||||
# Check that return type is specified and it is "None".
|
||||
if not isinstance(node.returns, Const) or node.returns.value != None:
|
||||
if not isinstance(node.returns, Const) or node.returns.value is not None:
|
||||
self.add_message("hass-constructor-return", node=node)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue