feat: add preset bool filter
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user