Documentation
¶
Overview ¶
Package pathspec evaluates lexical path filters without filesystem access.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasPathPrefix ¶
HasPathPrefix reports whether path is the same as prefix or is nested under it. Both inputs are normalized to slash-separated clean relative paths. @intent compare include path scopes after normalization so callers can test path containment reliably.
func IsRegexPattern ¶
IsRegexPattern detects whether a pattern uses regex syntax rather than glob. Checks for anchors ($) and escape sequences (\.) that are regex-specific. @intent glob과 정규표현식 패턴을 구분해 적절한 매칭 엔진을 선택한다.
func MatchExcludes ¶
MatchExcludes reports whether relPath matches any of the given exclude patterns.
Pattern forms:
- Path prefix: "vendor" or "internal/legacy" — excludes everything under that path.
- Filename glob: "*.pb.go" — matches files by name anywhere in the tree. Patterns without "/" are applied against the base file name only.
- Full-path glob: "internal/gen/*.go" — matched against the full slash-separated relPath.
relPath should be relative to the project root. OS-specific separators are normalized to forward slashes before matching. @intent 설정과 CLI에서 받은 제외 패턴을 상대 경로에 일관되게 적용한다. @domainRule 슬래시가 없는 패턴은 파일 basename에만 매칭한다.
func MatchIncludePaths ¶
MatchIncludePaths reports whether relPath falls inside or is an ancestor of any configured include path. @intent let walkers prune directories that lie outside user-selected include scopes while still descending into ancestors.
Types ¶
This section is empty.