diff options
Diffstat (limited to 'doc/how_tos/custom_checkers.rst')
-rw-r--r-- | doc/how_tos/custom_checkers.rst | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/doc/how_tos/custom_checkers.rst b/doc/how_tos/custom_checkers.rst index 0f6ff6062..30c70d63a 100644 --- a/doc/how_tos/custom_checkers.rst +++ b/doc/how_tos/custom_checkers.rst @@ -201,7 +201,19 @@ Add the ``register`` function to the top level of the file. .. code-block:: python - def register(linter): + from typing import TYPE_CHECKING + + import astroid + + if TYPE_CHECKING: + from pylint.lint import PyLinter + + + def register(linter: "PyLinter") -> None: + """This required method auto registers the checker during initialization. + + :param linter: The linter to register the checker to. + """ linter.register_checker(UniqueReturnChecker(linter)) We are now ready to debug and test our checker! |