Skip to content

Commit 35fa723

Browse files
committed
Temporarily drop support for duplicate imports
1 parent 8a7fe93 commit 35fa723

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

docs/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [0.8.0] - 09/02/2021
6+
7+
- Temporarily drop support for duplicate imports.
8+
59
## [0.7.4] - 19/02/2021
610

711
- [🐞 Fix list_paths in utils by @hakancelik96](https://github.com/hakancelik96/unimport/pull/172)

tests/test_refactor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def test_get_star_imp_none(self):
254254
""",
255255
)
256256

257-
257+
@unittest.skip
258258
class DuplicateUnusedRefactorTestCase(RefactorTestCase):
259259
def test_full_unused(self):
260260
self.assertActionAfterRefactorEqualToEmpty(
@@ -539,6 +539,7 @@ def test_multiple_import_name_as_import(self):
539539
""",
540540
)
541541

542+
@unittest.skip
542543
def test_multiple_import_name_as_import_duplicate(self):
543544
self.assertActionAfterRefactorEqualToExpected(
544545
"""\
@@ -553,6 +554,7 @@ def test_multiple_import_name_as_import_duplicate(self):
553554
""",
554555
)
555556

557+
@unittest.skip
556558
def test_as_import_used_all_cases(self):
557559
self.assertActionAfterRefactorEqualToExpected(
558560
"""\

tests/test_unused_import.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def test_double_underscore_builtins_names(self):
224224
"""
225225
)
226226

227-
227+
@unittest.skip
228228
class DuplicateTestCase(UnusedTestCase):
229229
def test__all__(self):
230230
self.assertSourceAfterScanningEqualToExpected(
@@ -1105,6 +1105,7 @@ def test_as_import_all_unused_all_cases(self):
11051105
],
11061106
)
11071107

1108+
@unittest.skip
11081109
def test_as_import_one_used_in_function_all_cases(self):
11091110
self.assertSourceAfterScanningEqualToExpected(
11101111
"""\

unimport/analyzer.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -461,13 +461,8 @@ def traverse(self) -> None:
461461

462462
def get_unused_imports(self) -> Iterator[C.ImportT]:
463463
for imp in self.imports:
464-
# duplicate import
465-
if self.is_duplicate(
466-
imp.name
467-
) and not self.is_duplicate_import_used(imp):
468-
yield imp
469464
# star import
470-
elif (
465+
if (
471466
self.include_star_import
472467
and isinstance(imp, ImportFrom)
473468
and imp.star

unimport/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
DESCRIPTION = (
3636
"A linter, formatter for finding and removing unused import statements."
3737
)
38-
VERSION = "0.7.4"
38+
VERSION = "0.8.0"
3939

4040
#  TYPE
4141
FunctionT = TypeVar("FunctionT", bound=Callable[..., Any])

0 commit comments

Comments
 (0)