Address new linter complaints

This commit is contained in:
Katrina Verey
2022-03-29 18:18:23 -04:00
parent b368b347d1
commit 14947e449b
77 changed files with 220 additions and 210 deletions

View File

@@ -49,5 +49,4 @@ linters-settings:
line-length: 170
gocyclo:
min-complexity: 30
golint:
min-confidence: 0.85

View File

@@ -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 . )

View File

@@ -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
}

View File

@@ -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"),

View File

@@ -1,4 +1,3 @@
//nolint
package funcwrappersrc
import (