Update full linter list and enable some easily resolved new ones

This commit is contained in:
Katrina Verey
2022-03-30 14:07:54 -04:00
parent 0a9c5cb0cf
commit 71bf0d5d14
61 changed files with 185 additions and 184 deletions

View File

@@ -22,11 +22,13 @@ type Harness struct {
}
func MakeHarness(t *testing.T) Harness {
t.Helper()
return MakeHarnessWithFs(t, filesys.MakeFsInMemory())
}
func MakeHarnessWithFs(
t *testing.T, fSys filesys.FileSystem) Harness {
t.Helper()
return Harness{
t: t,
fSys: fSys,

View File

@@ -47,6 +47,7 @@ type HarnessEnhanced struct {
}
func MakeEnhancedHarness(t *testing.T) *HarnessEnhanced {
t.Helper()
r := makeBaseEnhancedHarness(t)
r.Harness = MakeHarnessWithFs(t, filesys.MakeFsInMemory())
// Point the Harness's file loader to the root ('/')
@@ -56,6 +57,7 @@ func MakeEnhancedHarness(t *testing.T) *HarnessEnhanced {
}
func MakeEnhancedHarnessWithTmpRoot(t *testing.T) *HarnessEnhanced {
t.Helper()
r := makeBaseEnhancedHarness(t)
fSys := filesys.MakeFsOnDisk()
r.Harness = MakeHarnessWithFs(t, fSys)
@@ -72,6 +74,7 @@ func MakeEnhancedHarnessWithTmpRoot(t *testing.T) *HarnessEnhanced {
}
func makeBaseEnhancedHarness(t *testing.T) *HarnessEnhanced {
t.Helper()
rf := resmap.NewFactory(
provider.NewDefaultDepProvider().GetResourceFactory())
return &HarnessEnhanced{

View File

@@ -26,6 +26,7 @@ func AssertActualEqualsExpectedWithTweak(
t *testing.T,
m resmap.ResMap,
tweaker func([]byte) []byte, expected string) {
t.Helper()
if m == nil {
t.Fatalf("Map should not be nil.")
}
@@ -49,13 +50,14 @@ func AssertActualEqualsExpectedWithTweak(
// Pretty printing of file differences.
func reportDiffAndFail(
t *testing.T, actual []byte, expected string) {
t.Helper()
sE, maxLen := convertToArray(expected)
sA, _ := convertToArray(string(actual))
fmt.Println("===== ACTUAL BEGIN ========================================")
fmt.Print(string(actual))
fmt.Println("===== ACTUAL END ==========================================")
format := fmt.Sprintf("%%s %%-%ds %%s\n", maxLen+4)
limit := 0
var limit int
if len(sE) < len(sA) {
limit = len(sE)
} else {

View File

@@ -25,6 +25,7 @@ type pluginTestEnv struct {
// newPluginTestEnv returns a new instance of pluginTestEnv.
func newPluginTestEnv(t *testing.T) *pluginTestEnv {
t.Helper()
return &pluginTestEnv{t: t}
}