diff options
-rw-r--r-- | .isort.cfg | 2 | ||||
-rw-r--r-- | pylint/checkers/base.py | 3 | ||||
-rw-r--r-- | pylint/checkers/spelling.py | 5 | ||||
-rw-r--r-- | pylint/checkers/utils.py | 3 | ||||
-rwxr-xr-x | pylint/epylint.py | 2 | ||||
-rw-r--r-- | pylint/extensions/docparams.py | 2 | ||||
-rw-r--r-- | pylint/graph.py | 3 | ||||
-rw-r--r-- | setup.py | 2 | ||||
-rw-r--r-- | tests/checkers/unittest_typecheck.py | 2 | ||||
-rw-r--r-- | tests/extensions/test_bad_builtin.py | 3 | ||||
-rw-r--r-- | tests/extensions/test_broad_try_clause.py | 3 | ||||
-rw-r--r-- | tests/extensions/test_check_docs_utils.py | 2 | ||||
-rw-r--r-- | tests/extensions/test_check_mccabe.py | 2 | ||||
-rw-r--r-- | tests/extensions/test_elseif_used.py | 3 | ||||
-rw-r--r-- | tests/extensions/test_emptystring.py | 3 | ||||
-rw-r--r-- | tests/extensions/test_redefined.py | 3 | ||||
-rw-r--r-- | tests/lint/unittest_lint.py | 3 | ||||
-rw-r--r-- | tests/test_import_graph.py | 2 | ||||
-rw-r--r-- | tests/test_regr.py | 2 | ||||
-rw-r--r-- | tests/unittest_pyreverse_diadefs.py | 2 | ||||
-rw-r--r-- | tests/unittest_pyreverse_inspector.py | 2 | ||||
-rw-r--r-- | tox.ini | 2 |
22 files changed, 23 insertions, 33 deletions
diff --git a/.isort.cfg b/.isort.cfg index c4ae79c5e..4f3d4c822 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -4,4 +4,4 @@ line_length=88 known_third_party=astroid, sphinx, isort, pytest, mccabe, six, toml include_trailing_comma=True skip_glob=tests/functional/**,tests/input/**,tests/extensions/data/**,tests/regrtest_data/**,tests/data/**,astroid/**,venv/** -project=pylint +src_paths=pylint diff --git a/pylint/checkers/base.py b/pylint/checkers/base.py index e93ad66e5..d284ea37d 100644 --- a/pylint/checkers/base.py +++ b/pylint/checkers/base.py @@ -54,7 +54,6 @@ # For details: https://github.com/PyCQA/pylint/blob/master/COPYING """basic checker for Python code""" - import builtins import collections import itertools @@ -67,8 +66,8 @@ import astroid.bases import astroid.scoped_nodes from astroid.arguments import CallSite -import pylint.utils as lint_utils from pylint import checkers, exceptions, interfaces +from pylint import utils as lint_utils from pylint.checkers import utils from pylint.checkers.utils import ( is_overload_stub, diff --git a/pylint/checkers/spelling.py b/pylint/checkers/spelling.py index ad5ac9c21..dea75bef8 100644 --- a/pylint/checkers/spelling.py +++ b/pylint/checkers/spelling.py @@ -21,7 +21,6 @@ """Checker for spelling errors in comments and docstrings. """ - import os import re import tokenize @@ -33,12 +32,12 @@ from pylint.interfaces import IAstroidChecker, ITokenChecker try: import enchant from enchant.tokenize import ( # type: ignore - get_tokenizer, Chunker, - Filter, EmailFilter, + Filter, URLFilter, WikiWordFilter, + get_tokenizer, ) except ImportError: enchant = None diff --git a/pylint/checkers/utils.py b/pylint/checkers/utils.py index 912cac06c..e413ab199 100644 --- a/pylint/checkers/utils.py +++ b/pylint/checkers/utils.py @@ -50,13 +50,12 @@ import string from functools import lru_cache, partial from typing import Callable, Dict, Iterable, List, Match, Optional, Set, Tuple, Union +import _string import astroid from astroid import bases as _bases from astroid import helpers, scoped_nodes from astroid.exceptions import _NonDeducibleTypeHierarchy -import _string # pylint: disable=wrong-import-position, wrong-import-order - BUILTINS_NAME = builtins.__name__ COMP_NODE_TYPES = ( astroid.ListComp, diff --git a/pylint/epylint.py b/pylint/epylint.py index 00e8d1908..ba629af1d 100755 --- a/pylint/epylint.py +++ b/pylint/epylint.py @@ -56,10 +56,10 @@ You may also use py_run to run pylint with desired options and get back (or not) its output. """ import os -import os.path as osp import shlex import sys from io import StringIO +from os import path as osp from subprocess import PIPE, Popen diff --git a/pylint/extensions/docparams.py b/pylint/extensions/docparams.py index 85fcaab74..9db49864d 100644 --- a/pylint/extensions/docparams.py +++ b/pylint/extensions/docparams.py @@ -21,9 +21,9 @@ """ import astroid -import pylint.extensions._check_docs_utils as utils from pylint.checkers import BaseChecker from pylint.checkers import utils as checker_utils +from pylint.extensions import _check_docs_utils as utils from pylint.interfaces import IAstroidChecker diff --git a/pylint/graph.py b/pylint/graph.py index 823713e61..219d0b392 100644 --- a/pylint/graph.py +++ b/pylint/graph.py @@ -13,13 +13,12 @@ (dot generation adapted from pypy/translator/tool/make_dot.py) """ - import codecs import os -import os.path as osp import subprocess import sys import tempfile +from os import path as osp def target_info_from_filename(filename): @@ -39,8 +39,8 @@ try: USE_SETUPTOOLS = 1 except ImportError: - from distutils.core import setup from distutils.command import install_lib # pylint: disable=unused-import + from distutils.core import setup USE_SETUPTOOLS = 0 easy_install_lib = None diff --git a/tests/checkers/unittest_typecheck.py b/tests/checkers/unittest_typecheck.py index 3e8e26f2c..61d49d28f 100644 --- a/tests/checkers/unittest_typecheck.py +++ b/tests/checkers/unittest_typecheck.py @@ -26,7 +26,7 @@ from pylint.checkers import typecheck from pylint.testutils import CheckerTestCase, Message, set_config try: - import coverage.tracer as _ + from coverage import tracer as _ # pylint: disable=unused-import C_EXTENTIONS_AVAILABLE = True except ImportError: diff --git a/tests/extensions/test_bad_builtin.py b/tests/extensions/test_bad_builtin.py index 1ce365c28..a261c57fb 100644 --- a/tests/extensions/test_bad_builtin.py +++ b/tests/extensions/test_bad_builtin.py @@ -8,8 +8,7 @@ """Tests for the pylint checker in :mod:`pylint.extensions.bad_builtin """ - -import os.path as osp +from os import path as osp import pytest diff --git a/tests/extensions/test_broad_try_clause.py b/tests/extensions/test_broad_try_clause.py index 2cb457da9..146f02b17 100644 --- a/tests/extensions/test_broad_try_clause.py +++ b/tests/extensions/test_broad_try_clause.py @@ -8,9 +8,8 @@ # For details: https://github.com/PyCQA/pylint/blob/master/COPYING """Tests for the pylint checker in :mod:`pylint.extensions.broad_try_clause`""" - -import os.path as osp import unittest +from os import path as osp from pylint import checkers from pylint.extensions.broad_try_clause import BroadTryClauseChecker diff --git a/tests/extensions/test_check_docs_utils.py b/tests/extensions/test_check_docs_utils.py index cef73f846..24555f292 100644 --- a/tests/extensions/test_check_docs_utils.py +++ b/tests/extensions/test_check_docs_utils.py @@ -14,7 +14,7 @@ in particular the parameter documentation checker `DocstringChecker` import astroid import pytest -import pylint.extensions._check_docs_utils as utils +from pylint.extensions import _check_docs_utils as utils @pytest.mark.parametrize( diff --git a/tests/extensions/test_check_mccabe.py b/tests/extensions/test_check_mccabe.py index dfb846b3d..25b812645 100644 --- a/tests/extensions/test_check_mccabe.py +++ b/tests/extensions/test_check_mccabe.py @@ -10,7 +10,7 @@ """Tests for the pylint checker in :mod:`pylint.extensions.check_mccabe""" # pylint: disable=redefined-outer-name -import os.path as osp +from os import path as osp import pytest diff --git a/tests/extensions/test_elseif_used.py b/tests/extensions/test_elseif_used.py index 3b92ca7a4..57eda1429 100644 --- a/tests/extensions/test_elseif_used.py +++ b/tests/extensions/test_elseif_used.py @@ -9,8 +9,7 @@ """Tests for the pylint checker in :mod:`pylint.extensions.check_elif """ - -import os.path as osp +from os import path as osp import pytest diff --git a/tests/extensions/test_emptystring.py b/tests/extensions/test_emptystring.py index 16c39ac07..9a9e25ea5 100644 --- a/tests/extensions/test_emptystring.py +++ b/tests/extensions/test_emptystring.py @@ -12,8 +12,7 @@ """Tests for the pylint checker in :mod:`pylint.extensions.emptystring """ - -import os.path as osp +from os import path as osp import pytest diff --git a/tests/extensions/test_redefined.py b/tests/extensions/test_redefined.py index 9fbf4829c..98f9106a0 100644 --- a/tests/extensions/test_redefined.py +++ b/tests/extensions/test_redefined.py @@ -7,8 +7,7 @@ # For details: https://github.com/PyCQA/pylint/blob/master/COPYING """Tests for the pylint checker in :mod:`pylint.extensions.check_elif""" - -import os.path as osp +from os import path as osp import pytest diff --git a/tests/lint/unittest_lint.py b/tests/lint/unittest_lint.py index 46ea1a62c..380f80d43 100644 --- a/tests/lint/unittest_lint.py +++ b/tests/lint/unittest_lint.py @@ -47,8 +47,7 @@ from shutil import rmtree import pytest -import pylint.testutils as testutils -from pylint import checkers, config, exceptions, interfaces, lint +from pylint import checkers, config, exceptions, interfaces, lint, testutils from pylint.checkers.utils import check_messages from pylint.constants import ( MSG_STATE_CONFIDENCE, diff --git a/tests/test_import_graph.py b/tests/test_import_graph.py index b5c910ab8..3abc4fd9c 100644 --- a/tests/test_import_graph.py +++ b/tests/test_import_graph.py @@ -18,7 +18,7 @@ from os.path import exists import pytest -import pylint.testutils as testutils +from pylint import testutils from pylint.checkers import imports, initialize from pylint.lint import PyLinter diff --git a/tests/test_regr.py b/tests/test_regr.py index 893c9f847..8ee871005 100644 --- a/tests/test_regr.py +++ b/tests/test_regr.py @@ -24,7 +24,7 @@ from os.path import abspath, dirname, join import astroid import pytest -import pylint.testutils as testutils +from pylint import testutils REGR_DATA = join(dirname(abspath(__file__)), "regrtest_data") sys.path.insert(1, REGR_DATA) diff --git a/tests/unittest_pyreverse_diadefs.py b/tests/unittest_pyreverse_diadefs.py index 302c5314e..6938a98cc 100644 --- a/tests/unittest_pyreverse_diadefs.py +++ b/tests/unittest_pyreverse_diadefs.py @@ -19,6 +19,7 @@ from pathlib import Path import astroid import pytest +from unittest_pyreverse_writer import Config, get_project from pylint.pyreverse.diadefslib import ( ClassDiadefGenerator, @@ -27,7 +28,6 @@ from pylint.pyreverse.diadefslib import ( DiadefsHandler, ) from pylint.pyreverse.inspector import Linker -from unittest_pyreverse_writer import Config, get_project def _process_classes(classes): diff --git a/tests/unittest_pyreverse_inspector.py b/tests/unittest_pyreverse_inspector.py index e77de2e72..464b9d07e 100644 --- a/tests/unittest_pyreverse_inspector.py +++ b/tests/unittest_pyreverse_inspector.py @@ -16,9 +16,9 @@ import os import astroid import pytest from astroid import bases, nodes +from unittest_pyreverse_writer import get_project from pylint.pyreverse import inspector -from unittest_pyreverse_writer import get_project @pytest.fixture @@ -40,7 +40,7 @@ deps = isort==5.4.2 commands = black --check . --exclude="tests/functional/|tests/input|tests/extensions/data|tests/regrtest_data/|tests/data/|venv|astroid|.tox" - isort -rc . --check-only + isort . --check-only changedir = {toxinidir} [testenv:mypy] |