Skip to content

Commit 2f928f7

Browse files
committed
Fix type annotations.
1 parent af68fbb commit 2f928f7

File tree

3 files changed

+19
-22
lines changed

3 files changed

+19
-22
lines changed

notebook2script/pointless.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@
147147
# 3rd party
148148
from astroid import Expr # type: ignore[import-untyped]
149149
from domdf_python_tools.paths import PathPlus
150-
from pylint import reporters
151-
from pylint.lint.pylinter import PyLinter
152-
from pylint.utils import utils
150+
from pylint import reporters # type: ignore[import-untyped]
151+
from pylint.lint.pylinter import PyLinter # type: ignore[import-untyped]
152+
from pylint.utils import utils # type: ignore[import-untyped]
153153

154154
# this package
155155
from notebook2script import pointless_checker
@@ -175,13 +175,13 @@ def load_default_plugins(self) -> None: # noqa: D102
175175
# Make sure to load the default reporter, because
176176
# the option has been set before the plugins had been loaded.
177177
if not self.reporter:
178-
self._load_reporter() # type: ignore[attr-defined]
178+
self._load_reporter()
179179

180180
def process_file(self, filename: str) -> None: # noqa: D102
181181
self.statements = []
182182

183183
with fix_import_path([filename]):
184-
self._check_files(self.get_ast, self._iterate_file_descrs([filename])) # type: ignore[attr-defined]
184+
self._check_files(self.get_ast, self._iterate_file_descrs([filename]))
185185

186186
path = PathPlus(filename)
187187
file_lines = path.read_lines()
@@ -235,7 +235,7 @@ def _patch_sys_path(args: Iterable[str]) -> List[str]:
235235
changes = []
236236
seen = set()
237237
for arg in args:
238-
path = utils.get_python_path(arg) # type: ignore[attr-defined]
238+
path = utils.get_python_path(arg)
239239
if path not in seen:
240240
changes.append(path)
241241
seen.add(path)

notebook2script/pointless_checker/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
#
2626

2727
# 3rd party
28-
from pylint.checkers.base_checker import BaseChecker, BaseTokenChecker
29-
from pylint.lint.pylinter import PyLinter
30-
from pylint.utils import register_plugins
28+
from pylint.checkers.base_checker import BaseChecker, BaseTokenChecker # type: ignore[import-untyped]
29+
from pylint.lint.pylinter import PyLinter # type: ignore[import-untyped]
30+
from pylint.utils import register_plugins # type: ignore[import-untyped]
3131

3232

3333
def initialize(linter: PyLinter) -> None:

notebook2script/pointless_checker/base.py

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,22 @@
2424
# MA 02110-1301, USA.
2525
#
2626

27-
# stdlib
28-
from typing import Dict, Tuple
29-
3027
# 3rd party
3128
import astroid # type: ignore[import-untyped]
3229
import astroid.bases # type: ignore[import-untyped]
3330
import astroid.scoped_nodes # type: ignore[import-untyped]
3431
from astroid import Expr
35-
from pylint import interfaces
36-
from pylint.checkers import utils
37-
from pylint.checkers.base_checker import BaseChecker
38-
from pylint.lint.pylinter import PyLinter
32+
from pylint import interfaces # type: ignore[import-untyped]
33+
from pylint.checkers import utils # type: ignore[import-untyped]
34+
from pylint.checkers.base_checker import BaseChecker # type: ignore[import-untyped]
35+
from pylint.lint.pylinter import PyLinter # type: ignore[import-untyped]
3936

4037
__all__ = ["BasicChecker", "register"]
4138

4239

4340
class BasicChecker(BaseChecker): # noqa: D101
4441

45-
__implements__ = interfaces.IAstroidChecker # type: ignore[attr-defined]
42+
__implements__ = interfaces.IAstroidChecker
4643

4744
msgs = {
4845
"W0104": (
@@ -68,11 +65,11 @@ class BasicChecker(BaseChecker): # noqa: D101
6865

6966
reports = ()
7067

71-
@utils.check_messages( # type: ignore[attr-defined]
72-
"pointless-statement",
73-
"pointless-string-statement",
74-
"expression-not-assigned",
75-
)
68+
@utils.check_messages(
69+
"pointless-statement",
70+
"pointless-string-statement",
71+
"expression-not-assigned",
72+
)
7673
def visit_expr(self, node: Expr) -> None:
7774
"""
7875
Check for various kinds of statements without effect.

0 commit comments

Comments
 (0)