Documentation
¶
Overview ¶
Package pathutil provides path-related utilities for the ccg CLI.
Index ¶
- func HasPathPrefix(pathValue, prefix string) bool
- func IsRegexPattern(pat string) bool
- func LoadIncludePathsFromConfig(dir string) ([]string, error)
- func MatchExcludes(patterns []string, relPath string) bool
- func MatchIncludePaths(relPath string, includePaths []string) bool
- func ShouldSkipDir(name string) bool
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.
func ShouldSkipDir ¶
ShouldSkipDir는 디렉토리 이름이 기본 제외 대상인지 반환한다. .git, vendor, node_modules, 그리고 "."으로 시작하는 숨김 디렉토리를 제외한다. @intent 공통적으로 분석 대상에서 빼야 하는 디렉터리를 빠르게 걸러낸다. @domainRule 숨김 디렉터리는 현재 디렉터리 표기 "."를 제외하고 모두 스킵한다.
Types ¶
This section is empty.