feat: add preset bool filter

This commit is contained in:
2026-08-10 13:36:12 +03:00
parent 9d15380443
commit a77a430d51
6 changed files with 34 additions and 11 deletions
+7 -2
View File
@@ -3,6 +3,7 @@ from typing import Iterable
from pathspec import PathSpec
from ..preset.detector import ENTRY_SKIP
from .detector import EntryDetector
from .entry import Entry
@@ -15,12 +16,16 @@ class EntryResolver:
def _resolve(self, basepath: Path, depth: int = 0) -> Iterable[Entry]:
if basepath.is_dir():
if self._ignore.match_file(basepath):
if basepath.name.startswith(".") or self._ignore.match_file(basepath):
return
entry = self._detector.detect_entry(basepath)
if entry:
yield entry
if depth < self._max_depth and basepath.is_dir():
if (
not entry == ENTRY_SKIP
and depth < self._max_depth
and basepath.is_dir()
):
for path in basepath.iterdir():
yield from self._resolve(path, depth + 1)