(
root: Path,
include_patterns: Sequence[str],
exclude_patterns: Sequence[str],
include_hidden: bool,
)
| 1007 | |
| 1008 | |
| 1009 | def _iter_candidate_files( |
| 1010 | root: Path, |
| 1011 | include_patterns: Sequence[str], |
| 1012 | exclude_patterns: Sequence[str], |
| 1013 | include_hidden: bool, |
| 1014 | ) -> Iterable[Path]: |
| 1015 | yielded: set[str] = set() |
| 1016 | for pattern in include_patterns: |
| 1017 | for candidate in root.glob(pattern): |
| 1018 | if not candidate.is_file(): |
| 1019 | continue |
| 1020 | rel = candidate.relative_to(root) |
| 1021 | rel_key = rel.as_posix() |
| 1022 | if rel_key in yielded: |
| 1023 | continue |
| 1024 | if not include_hidden and _path_is_hidden(rel): |
| 1025 | continue |
| 1026 | if _is_excluded(rel_key, exclude_patterns): |
| 1027 | continue |
| 1028 | yielded.add(rel_key) |
| 1029 | yield candidate |
| 1030 | |
| 1031 | |
| 1032 | def _path_is_hidden(path: Path) -> bool: |
no test coverage detected