summaryrefslogtreecommitdiff
path: root/isort/wrap.py
diff options
context:
space:
mode:
authorTimothy Crosley <timothy.crosley@gmail.com>2019-11-08 00:34:48 -0800
committerTimothy Crosley <timothy.crosley@gmail.com>2019-11-08 00:34:48 -0800
commit592d07a364a7d8a2fcf2c2b55e42a8f6507209e6 (patch)
tree4d8c4b37aba36811c037ae50970ab064efc20d08 /isort/wrap.py
parentaaac1ae0667dabe6fd038c9f5a42c157b9457ef1 (diff)
downloadisort-592d07a364a7d8a2fcf2c2b55e42a8f6507209e6.tar.gz
Fix all discovered mypy errors
Diffstat (limited to 'isort/wrap.py')
-rw-r--r--isort/wrap.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/isort/wrap.py b/isort/wrap.py
index fa7349ba..db67f105 100644
--- a/isort/wrap.py
+++ b/isort/wrap.py
@@ -12,8 +12,8 @@ def import_statement(
from_imports: List[str],
comments: Sequence[str],
line_separator: str,
- config: Config=DEFAULT_CONFIG,
- multi_line_output: Optional[Modes]=None
+ config: Config = DEFAULT_CONFIG,
+ multi_line_output: Optional[Modes] = None,
) -> str:
"""Returns a multi-line wrapped form of the provided from import statement."""
formatter = formatter_from_string((multi_line_output or config.multi_line_output).name)
@@ -61,7 +61,7 @@ def import_statement(
return import_statement
-def line(line: str, line_separator: str, config: Config=DEFAULT_CONFIG) -> str:
+def line(line: str, line_separator: str, config: Config = DEFAULT_CONFIG) -> str:
"""Returns a line wrapped to the specified line-length, if possible."""
wrap_mode = config.multi_line_output
if len(line) > config.line_length and wrap_mode != Modes.NOQA: # type: ignore
@@ -79,9 +79,7 @@ def line(line: str, line_separator: str, config: Config=DEFAULT_CONFIG) -> str:
_comma_maybe = "," if config.include_trailing_comma else ""
line_parts[-1] = f"{line_parts[-1].strip()}{_comma_maybe} #{comment}"
next_line = []
- while (len(line) + 2) > (
- config.wrap_length or config.line_length
- ) and line_parts:
+ while (len(line) + 2) > (config.wrap_length or config.line_length) and line_parts:
next_line.append(line_parts.pop())
line = splitter.join(line_parts)
if not line: