file
file ¶
File
dataclass
¶
A file path wrapper with glob matching, prefix checks, and test-file detection.
Delegates Path methods via __getattr__ so .suffix, .name,
.parent, .exists() etc. work directly.
PathMatcher
dataclass
¶
A reusable set of glob patterns for matching file paths. Supports in operator.
categorize_files ¶
categorize_files(
paths: Iterable[str | Path], *, lang: str = "py"
) -> tuple[list[str], list[str], list[str]]
Split paths into source, test, and skipped buckets for a language.
A path that does not match the lang globs is skipped; otherwise it is
classified as a test file (via :attr:File.is_test, which treats conftest.py
and anything under a tests/ directory as tests) or as source.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
paths
|
Iterable[str | Path]
|
File paths to categorize; blank entries are ignored. |
required |
lang
|
str
|
Language key into |
'py'
|
Returns:
| Type | Description |
|---|---|
list[str]
|
A |
list[str]
|
path strings. |