1
0
mirror of https://github.com/mgechev/revive.git synced 2024-11-21 17:16:40 +02:00

feat: ignore vendor if no exclude set (#1058)

This commit is contained in:
Marcin Federowicz 2024-10-18 00:25:24 +02:00 committed by GitHub
parent cea28f882a
commit 501cc4a675
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -82,6 +82,11 @@ func (r *Revive) Lint(patterns ...*LintPattern) (<-chan lint.Failure, error) {
if len(excludePatterns) == 0 { // if no excludes were set
excludePatterns = r.config.Exclude // use those from the configuration
}
// by default if no excludes exclude vendor
if len(excludePatterns) == 0 {
excludePatterns = []string{"vendor/..."}
}
packages, err := getPackages(includePatterns, excludePatterns)
if err != nil {