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)
30 lines
661 B
Go
30 lines
661 B
Go
package golinters
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/Antonboom/nilnil/pkg/analyzer"
|
|
"golang.org/x/tools/go/analysis"
|
|
|
|
"github.com/golangci/golangci-lint/pkg/config"
|
|
"github.com/golangci/golangci-lint/pkg/golinters/goanalysis"
|
|
)
|
|
|
|
func NewNilNil(cfg *config.NilNilSettings) *goanalysis.Linter {
|
|
a := analyzer.New()
|
|
|
|
cfgMap := make(map[string]map[string]interface{})
|
|
if cfg != nil && len(cfg.CheckedTypes) != 0 {
|
|
cfgMap[a.Name] = map[string]interface{}{
|
|
"checked-types": strings.Join(cfg.CheckedTypes, ","),
|
|
}
|
|
}
|
|
|
|
return goanalysis.NewLinter(
|
|
a.Name,
|
|
a.Doc,
|
|
[]*analysis.Analyzer{a},
|
|
cfgMap,
|
|
).
|
|
WithLoadMode(goanalysis.LoadModeTypesInfo)
|
|
}
|