mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-13 12:06:29 +00:00
82fd65665f
bidichk checks for dangerous unicode character sequences (https://github.com/golangci/golangci-lint/pull/2330)
33 lines
610 B
Go
33 lines
610 B
Go
package golinters
|
|
|
|
import (
|
|
"github.com/sivchari/tenv"
|
|
"golang.org/x/tools/go/analysis"
|
|
|
|
"github.com/golangci/golangci-lint/pkg/config"
|
|
"github.com/golangci/golangci-lint/pkg/golinters/goanalysis"
|
|
)
|
|
|
|
func NewTenv(settings *config.TenvSettings) *goanalysis.Linter {
|
|
a := tenv.Analyzer
|
|
|
|
analyzers := []*analysis.Analyzer{
|
|
a,
|
|
}
|
|
|
|
var cfg map[string]map[string]interface{}
|
|
if settings != nil {
|
|
cfg = map[string]map[string]interface{}{
|
|
a.Name: {
|
|
tenv.A: settings.All,
|
|
},
|
|
}
|
|
}
|
|
|
|
return goanalysis.NewLinter(
|
|
a.Name,
|
|
a.Doc,
|
|
analyzers,
|
|
cfg,
|
|
).WithLoadMode(goanalysis.LoadModeSyntax)
|
|
}
|