Skip to content

Commit

Permalink
Merge pull request #20 from ssciwr/non-existing-files
Browse files Browse the repository at this point in the history
Filter out files that do not exist in the working copy
  • Loading branch information
dokempf authored Mar 20, 2024
2 parents a141eff + 5ce90f7 commit 6019b20
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion precommend/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
class GenerationContext:
def __init__(self):
self._path = os.path.realpath(".")
self._files = get_all_files()
# We use get_all_files from pre-commit as it respects .gitignore, but
# we need to filter out files that do not exist in the working copy.
self._files = [f for f in get_all_files() if os.path.exists(f)]
self._tags = functools.reduce(
lambda a, b: a.union(b), map(tags_from_path, self._files), set()
)
Expand Down

0 comments on commit 6019b20

Please sign in to comment.