diff options
author | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-12-27 21:30:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-27 21:30:34 +0100 |
commit | 7d2584251552283bf95893019e74dad0390dc65c (patch) | |
tree | 7b5b8fa573a94d73b97741789a3e1fe35c7e7824 /pylint/checkers/async.py | |
parent | 691b41b3ddd3b533bce4d6a1f03ebc1e5cacf508 (diff) | |
download | pylint-git-7d2584251552283bf95893019e74dad0390dc65c.tar.gz |
Add typing and uniformize the checker registering in Pylinter (#5558)
Remove verbose docstring in code, keep them in example and doc
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Diffstat (limited to 'pylint/checkers/async.py')
-rw-r--r-- | pylint/checkers/async.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pylint/checkers/async.py b/pylint/checkers/async.py index 9aaead7c4..4a5c6abf2 100644 --- a/pylint/checkers/async.py +++ b/pylint/checkers/async.py @@ -11,6 +11,7 @@ """Checker for anything related to the async protocol (PEP 492).""" import sys +from typing import TYPE_CHECKING import astroid from astroid import nodes @@ -19,6 +20,9 @@ from pylint import checkers, interfaces, utils from pylint.checkers import utils as checker_utils from pylint.checkers.utils import decorated_with +if TYPE_CHECKING: + from pylint.lint import PyLinter + class AsyncChecker(checkers.BaseChecker): __implements__ = interfaces.IAstroidChecker @@ -94,6 +98,5 @@ class AsyncChecker(checkers.BaseChecker): ) -def register(linter): - """required method to auto register this checker""" +def register(linter: "PyLinter") -> None: linter.register_checker(AsyncChecker(linter)) |