woodpecker/vendor/github.com/golangci/golangci-lint/pkg/packages/skip.go
Lukas c28f7cb29f
Add golangci-lint (#502)
Initial part of #435
2021-11-14 21:01:54 +01:00

25 lines
528 B
Go

package packages
import (
"fmt"
"path/filepath"
"regexp"
)
func pathElemReImpl(e string, sep rune) string {
escapedSep := regexp.QuoteMeta(string(sep)) // needed for windows sep '\\'
return fmt.Sprintf(`(^|%s)%s($|%s)`, escapedSep, e, escapedSep)
}
func pathElemRe(e string) string {
return pathElemReImpl(e, filepath.Separator)
}
var StdExcludeDirRegexps = []string{
pathElemRe("vendor"),
pathElemRe("third_party"),
pathElemRe("testdata"),
pathElemRe("examples"),
pathElemRe("Godeps"),
pathElemRe("builtin"),
}