Skip to content

Commit

Permalink
Filter out files that do not exist in the working copy
Browse files Browse the repository at this point in the history
  • Loading branch information
dokempf committed Mar 20, 2024
1 parent 6a01da2 commit 5ce90f7
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 5ce90f7

Please sign in to comment.