isPathExcluded returns true when the given relative file path should be skipped based on hardcoded dir rules or .gitignore patterns.
(relPath string, gitignorePatterns []string)
| 185 | // isPathExcluded returns true when the given relative file path should be skipped |
| 186 | // based on hardcoded dir rules or .gitignore patterns. |
| 187 | func (p *Provider) isPathExcluded(relPath string, gitignorePatterns []string) bool { |
| 188 | // Hardcoded directory prefix checks |
| 189 | for _, prefix := range providerDirIgnoreDirs { |
| 190 | dirPart := strings.TrimSuffix(prefix, "/") |
| 191 | if relPath == dirPart || strings.HasPrefix(relPath, prefix) { |
| 192 | return true |
| 193 | } |
| 194 | } |
| 195 | |
| 196 | // .gitignore pattern matching |
| 197 | for _, pat := range gitignorePatterns { |
| 198 | if matchGitignorePattern(relPath, pat) { |
| 199 | return true |
| 200 | } |
| 201 | } |
| 202 | return false |
| 203 | } |
| 204 | |
| 205 | // matchGitignorePattern checks if relPath matches a single .gitignore pattern. |
| 206 | func matchGitignorePattern(relPath, pat string) bool { |
no test coverage detected