Skip to content

Commit

Permalink
Fixed #1399: --skip can error in the case of projects that contain re…
Browse files Browse the repository at this point in the history
…cursive symlinks.
  • Loading branch information
timothycrosley committed Aug 22, 2020
1 parent ec63f34 commit 8bd4d3f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ NOTE: isort follows the [semver](https://semver.org/) versioning standard.
### 5.5.0 TBD
- Fixed #1398: isort: off comment doesn't work, if it's the top comment in the file.
- Fixed #1395: reverse_relative setting doesn't have any effect when combined with force_sort_within_sections.

- Fixed #1399: --skip can error in the case of projects that contain recursive for-loops.

### 5.4.2 Aug 14, 2020
- Fixed #1383: Known other does not work anymore with .editorconfig.
- Fixed: Regression in first known party path expansion.
Expand Down
13 changes: 6 additions & 7 deletions isort/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,16 @@ def iter_source_code(paths: Iterable[str], config: Config, skipped: List[str]) -
base_path = Path(dirpath)
for dirname in list(dirnames):
full_path = base_path / dirname
resolved_path = full_path.resolve()
if config.is_skipped(full_path):
skipped.append(dirname)
dirnames.remove(dirname)

resolved_path = full_path.resolve()
if resolved_path in visited_dirs: # pragma: no cover
if not config.quiet:
warn(f"Likely recursive symlink detected to {resolved_path}")
dirnames.remove(dirname)
else:
visited_dirs.add(resolved_path)
if resolved_path in visited_dirs: # pragma: no cover
if not config.quiet:
warn(f"Likely recursive symlink detected to {resolved_path}")
dirnames.remove(dirname)
visited_dirs.add(resolved_path)

for filename in filenames:
filepath = os.path.join(dirpath, filename)
Expand Down

0 comments on commit 8bd4d3f

Please sign in to comment.