diff --git a/.editorconfig b/.editorconfig index e259285e8..17f5923b5 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,7 +5,6 @@ insert_final_newline = true [*.py] indent_style = space indent_size = 4 -not_skip = __init__.py [*.{css,mustache,py}] # Make sure that no Byte Order Marks are added diff --git a/.pylintrc b/.pylintrc index 9690e417e..ad224966d 100644 --- a/.pylintrc +++ b/.pylintrc @@ -66,7 +66,7 @@ confidence= # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" disable=missing-docstring,too-few-public-methods,too-many-return-statements,too-many-branches, - too-many-statements,line-too-long + too-many-statements,line-too-long,wrong-import-order [REPORTS] diff --git a/dev.py b/dev.py index 009d2a3a2..5b7e7e9e9 100644 --- a/dev.py +++ b/dev.py @@ -226,7 +226,7 @@ def upload_coverage() -> None: def sort(fix: bool = False) -> None: print('>>>> Checking imports') if fix: - subprocess.check_call(['isort', '-rc', '.']) + subprocess.check_call(['isort', '.']) else: subprocess.check_call(['isort', '--check-only']) diff --git a/pylint_monolith/monolith_checker.py b/pylint_monolith/monolith_checker.py index 5ec568401..ed0f03ed7 100644 --- a/pylint_monolith/monolith_checker.py +++ b/pylint_monolith/monolith_checker.py @@ -44,16 +44,13 @@ class MonolithChecker(BaseChecker): def __init__(self, linter: Optional[PyLinter] = None) -> None: BaseChecker.__init__(self, linter) - self.isort_obj = isort.SortImports( - file_contents='', - ) @check_messages(*(msgs.keys())) def visit_importfrom(self, node: astroid.nodes.ImportFrom) -> None: """triggered when a from statement is seen""" # We only care about imports within the monolith. basename = get_basename(node.modname) - import_category = self.isort_obj.place_module(basename) + import_category = isort.place.module(basename) if import_category != 'FIRSTPARTY': return # Get the name of the module that's doing the importing. diff --git a/requirements.txt b/requirements.txt index ae9cb2cd1..f8f5923d7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -21,7 +21,7 @@ git+https://github.com/Czaki/pip-check-reqs.git@master github_webhook==1.0.4 google-api-python-client==1.9.3 inflect==4.1.0 -isort==4.3.21 +isort==5.0.3 jsbeautifier==1.11.0 markdown==3.2.2 matplotlib==3.2.2