Skip to content

Commit

Permalink
Merge pull request #282 from vintasoftware/fix-working-dir-detection
Browse files Browse the repository at this point in the history
Fix working dir detection
  • Loading branch information
chocoelho authored Nov 17, 2018
2 parents 376e9f5 + c6fbc59 commit 94a8475
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ docs/_build

# emacs
TAGS
flycheck*
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
fail_fast: true
repos:
- repo: git://github.com/pre-commit/pre-commit-hooks
rev: v1.2.3
Expand Down
2 changes: 1 addition & 1 deletion prospector/finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def get_minimal_syspath(self, absolute_paths=True):
if dirname not in packages:
module_list.append(dirname)

full_list = sorted(set(module_list) | package_list, key=len)
full_list = sorted(set(module_list) | package_list | {self.rootpath}, key=len)
if absolute_paths:
full_list = [os.path.join(self.rootpath, p).rstrip(os.path.sep) for p in full_list]
return full_list
Expand Down
1 change: 1 addition & 0 deletions tests/finder/test_file_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def _run_test(self, name, expected):
files = find_python([], [root], explicit_file_mode=False)

expected = [os.path.relpath(os.path.join(root, e).rstrip(os.path.sep)) for e in expected]
expected.append(files.rootpath)
actual = files.get_minimal_syspath()

expected.sort(key=lambda x: len(x))
Expand Down

0 comments on commit 94a8475

Please sign in to comment.