Skip to content

Commit

Permalink
Fix problems found by deepsource
Browse files Browse the repository at this point in the history
  • Loading branch information
timothycrosley committed Jul 1, 2020
1 parent 35c1f70 commit 91b03ad
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 13 deletions.
4 changes: 2 additions & 2 deletions isort/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
show_unified_diff,
)
from .io import Empty
from .place import module as place_module
from .place import module_with_reason as place_module_with_reason
from .place import module as place_module # skipcq: PYL-W0611 (intended export of public API)
from .place import module_with_reason as place_module_with_reason # skipcq: PYL-W0611 (^)
from .settings import DEFAULT_CONFIG, FILE_SKIP_COMMENTS, Config

CIMPORT_IDENTIFIERS = ("cimport ", "cimport*", "from.cimport")
Expand Down
2 changes: 1 addition & 1 deletion isort/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ def parse_args(argv: Optional[Sequence[str]] = None) -> Dict[str, Any]:

def _preconvert(item):
"""Preconverts objects from native types into JSONifyiable types"""
if isinstance(item, frozenset) or isinstance(item, set):
if isinstance(item, (set, frozenset)):
return list(item)
elif isinstance(item, WrapModes):
return item.name
Expand Down
1 change: 0 additions & 1 deletion isort/place.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Contains all logic related to placing an import within a certain section."""
import importlib
import os
from fnmatch import fnmatch
from functools import lru_cache
from pathlib import Path
Expand Down
7 changes: 0 additions & 7 deletions isort/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,13 +452,6 @@ def _get_config_data(file_path: str, sections: Tuple[str]) -> Dict[str, Any]:
for key in section.split("."):
config_section = config_section.get(key, {})
settings.update(config_section)
else: # pragma: no cover
if "[tool.isort]" in config_file.read():
warnings.warn(
f"Found {file_path} with [tool.isort] section, but toml package is not "
f"installed. To configure isort with {file_path}, install with "
"'isort[pyproject]'."
)
else:
if file_path.endswith(".editorconfig"):
line = "\n"
Expand Down
2 changes: 1 addition & 1 deletion isort/setuptools_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def initialize_options(self) -> None:

def finalize_options(self) -> None:
"Get options from config files."
self.arguments: Dict[str, Any] = {}
self.arguments: Dict[str, Any] = {} # skipcq: PYL-W0201
self.arguments["settings_path"] = os.getcwd()

def distribution_files(self) -> Iterator[str]:
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_config_option_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
from typing import Any, Generator, Iterable, Type

from isort._future import dataclass, field
from isort._future import dataclass
from isort.main import _build_arg_parser
from isort.settings import _DEFAULT_SETTINGS as config

Expand Down

0 comments on commit 91b03ad

Please sign in to comment.