| Crates.io | uv-globfilter |
| lib.rs | uv-globfilter |
| version | 0.0.15 |
| created_at | 2025-11-20 23:30:07.224604+00 |
| updated_at | 2026-01-15 20:52:50.791757+00 |
| description | This is an internal component crate of uv |
| homepage | https://pypi.org/project/uv/ |
| repository | https://github.com/astral-sh/uv |
| max_upload_size | |
| id | 1942747 |
| size | 54,233 |
Portable directory walking with includes and excludes.
Motivating example: You want to allow the user to select paths within a project.
include = ["src", "License.txt", "resources/icons/*.svg"]
exclude = ["target", "/dist", ".cache", "*.tmp"]
When traversing the directory, you can use
GlobDirFilter::from_globs(...)?.match_directory(&relative) skip directories that never match in
WalkDirs filter_entry.
This crate supports the cross-language, restricted glob syntax from PEP 639:
_), hyphens (-) and dots (.) are matched verbatim.*: Matches any number of characters except path separators?: Matches a single character except the path separator**: Matches any number of characters including path separators[], containing only the verbatim matched characters: Matches a single of the characters
contained. Within [...], the hyphen indicates a locale-agnostic range (e.g., a-z, order
based on Unicode code points). Hyphens at the start or end are matched literally./). Patterns are relative to the given
directory, a leading slash character for absolute paths is not supported...) are not allowed.These rules mean that matching the backslash (\) is forbidden, which avoid collisions with the
windows path separator.