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

@@ -41,7 +41,7 @@ func TestIgnoreFilesMatcher_readIgnoreFile(t *testing.T) {
fsMakers := map[string]func(bool) (string, filesys.FileSystem){
// onDisk creates a temp directory and returns a nil FileSystem, testing
// the normal conditions under which ignoreFileMatcher is used.
"onDisk": func(writeIgnoreFile bool) (string, filesys.FileSystem) {
"onDisk": func(writeIgnoreFile bool) (string, filesys.FileSystem) { //nolint:unparam
dir, err := ioutil.TempDir("", "kyaml-test")
require.NoError(t, err)
@@ -107,10 +107,10 @@ func TestLocalPackageReader_Read_ignoreFile(t *testing.T) {
filepath.Join("a", "c"),
},
files: map[string][]byte{
filepath.Join("pkgFile"): {},
"pkgFile": {},
filepath.Join("a", "b", "a_test.yaml"): readFileA,
filepath.Join("a", "c", "c_test.yaml"): readFileB,
filepath.Join(".krmignore"): []byte(`
".krmignore": []byte(`
a/c/c_test.yaml
`,
),
@@ -127,10 +127,10 @@ a/c/c_test.yaml
filepath.Join("a", "c"),
},
files: map[string][]byte{
filepath.Join("pkgFile"): {},
"pkgFile": {},
filepath.Join("a", "b", "a_test.yaml"): readFileA,
filepath.Join("a", "c", "c_test.yaml"): readFileB,
filepath.Join(".krmignore"): []byte(`
".krmignore": []byte(`
a/c
`,
),
@@ -146,10 +146,10 @@ a/c
filepath.Join("a", "c"),
},
files: map[string][]byte{
filepath.Join("pkgFile"): {},
"pkgFile": {},
filepath.Join("a", "c", "a_test.yaml"): readFileA,
filepath.Join("a", "c", "c_test.yaml"): readFileB,
filepath.Join(".krmignore"): []byte(`
".krmignore": []byte(`
d/e/f.yaml
`,
),
@@ -168,10 +168,10 @@ a_test.yaml
filepath.Join("a", "c"),
},
files: map[string][]byte{
filepath.Join("pkgFile"): {},
"pkgFile": {},
filepath.Join("a", "c", "a_test.yaml"): readFileA,
filepath.Join("a", "c", "c_test.yaml"): readFileB,
filepath.Join(".krmignore"): []byte(`
".krmignore": []byte(`
a/c/c_test.yaml
`,
),
@@ -187,16 +187,16 @@ a_test.yaml
{
name: "handles a combination of packages and directories",
directories: []string{
filepath.Join("a"),
"a",
filepath.Join("d", "e"),
filepath.Join("f"),
"f",
},
files: map[string][]byte{
filepath.Join("pkgFile"): {},
"pkgFile": {},
filepath.Join("d", "pkgFile"): {},
filepath.Join("d", "e", "pkgFile"): {},
filepath.Join("f", "pkgFile"): {},
filepath.Join("manifest.yaml"): []byte(`root: root`),
"manifest.yaml": []byte(`root: root`),
filepath.Join("a", "manifest.yaml"): []byte(`a: a`),
filepath.Join("d", "manifest.yaml"): []byte(`d: d`),
filepath.Join("d", "e", "manifest.yaml"): []byte(`e: e`),
@@ -215,14 +215,14 @@ manifest.yaml
{
name: "ignore file can exclude subpackages",
directories: []string{
filepath.Join("a"),
"a",
},
files: map[string][]byte{
filepath.Join("pkgFile"): {},
"pkgFile": {},
filepath.Join("a", "pkgFile"): {},
filepath.Join("manifest.yaml"): []byte(`root: root`),
"manifest.yaml": []byte(`root: root`),
filepath.Join("a", "manifest.yaml"): []byte(`a: a`),
filepath.Join(".krmignore"): []byte(`
".krmignore": []byte(`
a
`),
},