mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-12 11:36:29 +00:00
56a854fe14
* update github.com/docker/cli * update github.com/docker/distribution * update github.com/docker/docker * update github.com/gin-gonic/gin * update github.com/golang-jwt/jwt/v4 * update github.com/golangci/golangci-lint * update github.com/gorilla/securecookie * update github.com/mattn/go-sqlite3 * update github.com/moby/moby * update github.com/prometheus/client_golang * update github.com/xanzy/go-gitlab
29 lines
803 B
Go
29 lines
803 B
Go
package golinters
|
|
|
|
import (
|
|
"4d63.com/gochecknoglobals/checknoglobals"
|
|
"golang.org/x/tools/go/analysis"
|
|
|
|
"github.com/golangci/golangci-lint/pkg/golinters/goanalysis"
|
|
)
|
|
|
|
func NewGochecknoglobals() *goanalysis.Linter {
|
|
gochecknoglobals := checknoglobals.Analyzer()
|
|
|
|
// gochecknoglobals only lints test files if the `-t` flag is passed, so we
|
|
// pass the `t` flag as true to the analyzer before running it. This can be
|
|
// turned off by using the regular golangci-lint flags such as `--tests` or
|
|
// `--skip-files`.
|
|
linterConfig := map[string]map[string]interface{}{
|
|
gochecknoglobals.Name: {
|
|
"t": true,
|
|
},
|
|
}
|
|
|
|
return goanalysis.NewLinter(
|
|
gochecknoglobals.Name,
|
|
gochecknoglobals.Doc,
|
|
[]*analysis.Analyzer{gochecknoglobals},
|
|
linterConfig,
|
|
).WithLoadMode(goanalysis.LoadModeSyntax)
|
|
}
|