Skip to content

Commit

Permalink
Switch to isort 5 for pylint's own code
Browse files Browse the repository at this point in the history
  • Loading branch information
dbaty authored and Pierre-Sassoulas committed Aug 18, 2020
1 parent 9bc9bdf commit 89f1a6f
Show file tree
Hide file tree
Showing 22 changed files with 23 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .isort.cfg
Expand Up @@ -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
3 changes: 1 addition & 2 deletions pylint/checkers/base.py
Expand Up @@ -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
Expand All @@ -67,8 +66,8 @@
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,
Expand Down
5 changes: 2 additions & 3 deletions pylint/checkers/spelling.py
Expand Up @@ -21,7 +21,6 @@

"""Checker for spelling errors in comments and docstrings.
"""

import os
import re
import tokenize
Expand All @@ -33,12 +32,12 @@
try:
import enchant
from enchant.tokenize import ( # type: ignore
get_tokenizer,
Chunker,
Filter,
EmailFilter,
Filter,
URLFilter,
WikiWordFilter,
get_tokenizer,
)
except ImportError:
enchant = None
Expand Down
3 changes: 1 addition & 2 deletions pylint/checkers/utils.py
Expand Up @@ -50,13 +50,12 @@
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,
Expand Down
2 changes: 1 addition & 1 deletion pylint/epylint.py
Expand Up @@ -56,10 +56,10 @@
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


Expand Down
2 changes: 1 addition & 1 deletion pylint/extensions/docparams.py
Expand Up @@ -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


Expand Down
3 changes: 1 addition & 2 deletions pylint/graph.py
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -39,8 +39,8 @@

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
Expand Down
2 changes: 1 addition & 1 deletion tests/checkers/unittest_typecheck.py
Expand Up @@ -26,7 +26,7 @@
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:
Expand Down
3 changes: 1 addition & 2 deletions tests/extensions/test_bad_builtin.py
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions tests/extensions/test_broad_try_clause.py
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/extensions/test_check_docs_utils.py
Expand Up @@ -14,7 +14,7 @@
import astroid
import pytest

import pylint.extensions._check_docs_utils as utils
from pylint.extensions import _check_docs_utils as utils


@pytest.mark.parametrize(
Expand Down
2 changes: 1 addition & 1 deletion tests/extensions/test_check_mccabe.py
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions tests/extensions/test_elseif_used.py
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions tests/extensions/test_emptystring.py
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions tests/extensions/test_redefined.py
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions tests/lint/unittest_lint.py
Expand Up @@ -47,8 +47,7 @@

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,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_import_graph.py
Expand Up @@ -18,7 +18,7 @@

import pytest

import pylint.testutils as testutils
from pylint import testutils
from pylint.checkers import imports, initialize
from pylint.lint import PyLinter

Expand Down
2 changes: 1 addition & 1 deletion tests/test_regr.py
Expand Up @@ -24,7 +24,7 @@
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)
Expand Down
2 changes: 1 addition & 1 deletion tests/unittest_pyreverse_diadefs.py
Expand Up @@ -19,6 +19,7 @@

import astroid
import pytest
from unittest_pyreverse_writer import Config, get_project

from pylint.pyreverse.diadefslib import (
ClassDiadefGenerator,
Expand All @@ -27,7 +28,6 @@
DiadefsHandler,
)
from pylint.pyreverse.inspector import Linker
from unittest_pyreverse_writer import Config, get_project


def _process_classes(classes):
Expand Down
2 changes: 1 addition & 1 deletion tests/unittest_pyreverse_inspector.py
Expand Up @@ -16,9 +16,9 @@
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
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Expand Up @@ -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]
Expand Down

0 comments on commit 89f1a6f

Please sign in to comment.