isPathExcluded returns true when the given relative file path should be skipped based on hardcoded dir rules or .gitignore patterns. Patterns are resolved the way git resolves them: in file order, with the LAST matching pattern deciding, and a leading "!" inverting that pattern's verdict. Order mat
(relPath string, gitignorePatterns []string)
| 311 | // correct under last-match-wins. Treating negations as unmatchable made every |
| 312 | // file in such a repository look excluded, so a review silently covered nothing. |
| 313 | func (p *Provider) isPathExcluded(relPath string, gitignorePatterns []string) bool { |
| 314 | return isProviderDirExcluded(relPath) || GitignorePatterns(gitignorePatterns).Matches(relPath) |
| 315 | } |
| 316 | |
| 317 | func (patterns GitignorePatterns) Matches(relPath string) bool { |
| 318 | excluded := false |
no test coverage detected