Skip to content

Commit

Permalink
feat: ignore vendor if no exclude set (#1058)
Browse files Browse the repository at this point in the history
  • Loading branch information
mfederowicz authored Oct 17, 2024
1 parent cea28f8 commit 501cc4a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions revivelib/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 501cc4a

Please sign in to comment.