Expand description
Path exclusion matching with mixed glob + prefix semantics.
This module provides two reusable helpers used by the rest of the workspace:
- [
build_glob_set] compiles a list of glob-pattern strings into aglobset::GlobSetusing the project’sGlobSettings. The file loader (crate::loader) uses this forsource.excludesentries that are pure glob patterns. ExclusionMatcherlayers on top ofbuild_glob_set, splitting an input list into glob patterns and plain prefixes.
§Pattern semantics used by ExclusionMatcher
Each pattern in the input list is classified as either a glob pattern
or a plain prefix based on whether it contains any glob metacharacters
(*, ?, [, {):
- Glob patterns (e.g.
src/**/*.php,tests/fixtures/*) are compiled via theglobsetcrate using the suppliedGlobSettingsand matched against the full file path. - Plain prefixes (e.g.
src,tests/fixtures/) use the pre-existing directory-prefix semantics: a patternXmatchesX,X/anything, or (if the pattern already ends with/) any path starting withX/.
This split keeps existing exclude = ["src/foo"] configurations working
exactly as before while adding full glob support for anyone who needs it.
Structs§
- Exclusion
Matcher - Compiled matcher for a list of exclusion patterns.
Functions§
- contains_
glob_ metacharacters - Returns
trueif the string contains any character that would make it a glob pattern rather than a literal path.