mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-17 18:25:26 +00:00
Address new linter complaints
This commit is contained in:
@@ -49,5 +49,4 @@ linters-settings:
|
||||
line-length: 170
|
||||
gocyclo:
|
||||
min-complexity: 30
|
||||
golint:
|
||||
min-confidence: 0.85
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ $(GOBIN)/addlicense:
|
||||
go get github.com/google/addlicense
|
||||
|
||||
$(GOBIN)/golangci-lint:
|
||||
go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.19.1
|
||||
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.45.2
|
||||
|
||||
$(GOBIN)/k8scopy:
|
||||
( cd ../k8scopy; go install . )
|
||||
|
||||
@@ -105,7 +105,7 @@ func (c *Converter) prepareWrapper(content string) string {
|
||||
}
|
||||
// assign to plugin variable
|
||||
if strings.TrimSpace(line) == "var plugin resmap.Configurable" {
|
||||
line = line + `
|
||||
line += `
|
||||
// KustomizePlugin is a global variable defined in every plugin
|
||||
plugin = &KustomizePlugin
|
||||
`
|
||||
@@ -156,7 +156,7 @@ func (c *Converter) mkDstDir() error {
|
||||
func (c *Converter) write(m map[string]string) error {
|
||||
for k, v := range m {
|
||||
p := filepath.Join(c.outputDir, k)
|
||||
err := ioutil.WriteFile(p, []byte(v), 0644)
|
||||
err := ioutil.WriteFile(p, []byte(v), 0644) //nolint:gosec
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ func TestTransformerConverter(t *testing.T) {
|
||||
dir := makeTempDir(t)
|
||||
defer os.RemoveAll(dir)
|
||||
|
||||
ioutil.WriteFile(filepath.Join(dir, "Plugin.go"),
|
||||
ioutil.WriteFile(filepath.Join(dir, "Plugin.go"), // nolint: gosec
|
||||
getTransformerCode(), 0644)
|
||||
|
||||
c := NewConverter(filepath.Join(dir, "output"),
|
||||
@@ -215,7 +215,7 @@ func TestGeneratorConverter(t *testing.T) {
|
||||
dir := makeTempDir(t)
|
||||
defer os.RemoveAll(dir)
|
||||
|
||||
ioutil.WriteFile(filepath.Join(dir, "Plugin.go"),
|
||||
ioutil.WriteFile(filepath.Join(dir, "Plugin.go"), // nolint: gosec
|
||||
getGeneratorCode(), 0644)
|
||||
|
||||
c := NewConverter(filepath.Join(dir, "output"),
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
//nolint
|
||||
package funcwrappersrc
|
||||
|
||||
import (
|
||||
|
||||
Reference in New Issue
Block a user