Skip to content

Commit

Permalink
Revert back to the upstream version
Browse files Browse the repository at this point in the history
  • Loading branch information
anirudnits committed Jun 20, 2021
1 parent c249cac commit 321b1db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
4 changes: 2 additions & 2 deletions isort/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,8 +705,8 @@ def _build_arg_parser() -> argparse.ArgumentParser:
dest="only_sections",
action="store_true",
help="Causes imports to be sorted based on their sections like STDLIB,THIRDPARTY etc. "
"Within sections, the imports maintain their relative positions irrespective of their "
"import_type",
"Within sections, the imports are ordered by their import style and the imports with "
"same style maintain their relative positions.",
)
section_group.add_argument(
"--ds",
Expand Down
11 changes: 1 addition & 10 deletions isort/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,7 @@ def sorted_imports(
lines_between = [""] * (
config.lines_between_types if from_modules and straight_modules else 0
)

if config.only_sections:
section_output = []
for section_import_type in parsed.original_order[section]:
if section_import_type == "from":
section_output.append(from_imports.pop(0))
else:
section_output.append(straight_imports.pop(0))

elif config.from_first:
if config.from_first:
section_output = from_imports + lines_between + straight_imports
else:
section_output = straight_imports + lines_between + from_imports
Expand Down

0 comments on commit 321b1db

Please sign in to comment.