Skip to content

Commit

Permalink
Improve handling of relative path detection
Browse files Browse the repository at this point in the history
  • Loading branch information
timothycrosley committed Jul 29, 2020
1 parent 1bf93c7 commit 92b84bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions isort/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,8 @@ def __init__(

def is_skipped(self, file_path: Path) -> bool:
"""Returns True if the file and/or folder should be skipped based on current settings."""
if self.directory and Path(self.directory) in file_path.parents:
file_name = os.path.relpath(file_path, self.directory)
if self.directory and Path(self.directory) in file_path.resolve().parents:
file_name = os.path.relpath(file_path.resolve(), self.directory)
else:
file_name = str(file_path)

Expand Down

0 comments on commit 92b84bd

Please sign in to comment.