Skip to content

Commit

Permalink
Fix list_paths in utils (#172)
Browse files Browse the repository at this point in the history
* Fix list_paths in utils

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* v0.7.4

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
hakancelikdev and pre-commit-ci[bot] authored Feb 19, 2021
1 parent e35daec commit 27f421d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
12 changes: 8 additions & 4 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,25 @@

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

## [0.7.4] - 19/02/2021

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

## [0.7.3] - 14/02/2021

- [Add `--ignore-init` flag by @hakancelik96](https://github.com/hakancelik96/unimport/pull/169)
- [💪 Add `--ignore-init` flag by @hakancelik96](https://github.com/hakancelik96/unimport/pull/169)

## [0.7.2] - 31/January/2021

- [Python3.9 Support by @hakancelik96](https://github.com/hakancelik96/unimport/pull/166)
- [💪 Python3.9 Support by @hakancelik96](https://github.com/hakancelik96/unimport/pull/166)

## [0.7.1] - 1/January/2021/

- [Fix by @hakancelik96 #127](https://github.com/hakancelik96/unimport/pull/161)
- [🐞 Fix by @hakancelik96 #127](https://github.com/hakancelik96/unimport/pull/161)

## [0.7.0] - 26/December/2020

- [%15 performance increase & remove show-error flag by @hakancelik96](https://github.com/hakancelik96/unimport/pull/159)
- [💊 %15 performance increase & remove show-error flag by @hakancelik96](https://github.com/hakancelik96/unimport/pull/159)

- [💪 Star import more accurate suggestion by @hakancelik96](https://github.com/hakancelik96/unimport/pull/158)

Expand Down
2 changes: 1 addition & 1 deletion docs/_coverpage.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- _coverpage.md -->

# ![logo](_media/icon.png ":size=30%") <small>0.7.3</small>
# ![logo](_media/icon.png ":size=30%") <small>0.7.4</small>

> A linter, formatter for finding and removing unused import statements.
Expand Down
Binary file added images/.DS_Store
Binary file not shown.
9 changes: 5 additions & 4 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ class TestUtils(unittest.TestCase):
maxDiff = None
include_star_import = True

def test_list_paths_and_read(self):
for path in [Path("tests"), Path("tests/test_config.py")]:
for p in utils.list_paths(path):
self.assertTrue(str(p).endswith(".py"))
def test_list_paths(self):
self.assertEqual(len(list(utils.list_paths(Path("tests")))), 8)
self.assertEqual(
len(list(utils.list_paths(Path("tests/test_config.py")))), 1
)

def refactor(self, path: Path) -> str:
source = utils.read(path)[0]
Expand Down
4 changes: 2 additions & 2 deletions unimport/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
DESCRIPTION = (
"A linter, formatter for finding and removing unused import statements."
)
VERSION = "0.7.3"
VERSION = "0.7.4"

PY38_PLUS = sys.version_info >= (3, 8)
PY39_PLUS = sys.version_info >= (3, 9)
Expand Down Expand Up @@ -107,6 +107,6 @@
BUILTIN_MODULE_NAMES = frozenset(sys.builtin_module_names)
STDLIB_PATH = distutils.sysconfig.get_python_lib(standard_lib=True)
GLOB_PATTERN = r"**/*.py"
INCLUDE_REGEX_PATTERN = r"\\.(py)$"
INCLUDE_REGEX_PATTERN = r"\.(py)$"
EXCLUDE_REGEX_PATTERN = r"^$"
INIT_FILE_IGNORE_REGEX = r"__init__\.py"

0 comments on commit 27f421d

Please sign in to comment.