ci: lint against dupl (#9357)

This lint rule should help us keep Go code redundancy under control.
This commit is contained in:
Ammar Bandukwala
2023-08-27 11:42:51 -05:00
committed by GitHub
parent 61634d482f
commit 4a140536e1
2 changed files with 8 additions and 14 deletions
+5
View File
@@ -2,6 +2,10 @@
# Over time we should try tightening some of these. # Over time we should try tightening some of these.
linters-settings: linters-settings:
dupl:
# goal: 100
threshold: 412
exhaustruct: exhaustruct:
include: include:
# Gradually extend to cover more of the codebase. # Gradually extend to cover more of the codebase.
@@ -268,3 +272,4 @@ linters:
- typecheck - typecheck
- unconvert - unconvert
- unused - unused
- dupl
+3 -14
View File
@@ -602,13 +602,9 @@ func TestUpdateValidateRichParameters(t *testing.T) {
// Update the workspace // Update the workspace
inv, root = clitest.New(t, "update", "my-workspace") inv, root = clitest.New(t, "update", "my-workspace")
clitest.SetupConfig(t, client, root) clitest.SetupConfig(t, client, root)
doneChan := make(chan struct{})
pty := ptytest.New(t).Attach(inv) pty := ptytest.New(t).Attach(inv)
go func() { clitest.Start(t, inv)
defer close(doneChan)
err := inv.Run()
assert.NoError(t, err)
}()
matches := []string{ matches := []string{
stringParameterName, "second_option", stringParameterName, "second_option",
@@ -623,7 +619,6 @@ func TestUpdateValidateRichParameters(t *testing.T) {
pty.WriteLine(value) pty.WriteLine(value)
} }
} }
<-doneChan
}) })
t.Run("ParameterOptionDisappeared", func(t *testing.T) { t.Run("ParameterOptionDisappeared", func(t *testing.T) {
@@ -668,13 +663,8 @@ func TestUpdateValidateRichParameters(t *testing.T) {
// Update the workspace // Update the workspace
inv, root = clitest.New(t, "update", "my-workspace") inv, root = clitest.New(t, "update", "my-workspace")
clitest.SetupConfig(t, client, root) clitest.SetupConfig(t, client, root)
doneChan := make(chan struct{})
pty := ptytest.New(t).Attach(inv) pty := ptytest.New(t).Attach(inv)
go func() { clitest.Start(t, inv)
defer close(doneChan)
err := inv.Run()
assert.NoError(t, err)
}()
matches := []string{ matches := []string{
stringParameterName, "Third option", stringParameterName, "Third option",
@@ -689,7 +679,6 @@ func TestUpdateValidateRichParameters(t *testing.T) {
pty.WriteLine(value) pty.WriteLine(value)
} }
} }
<-doneChan
}) })
t.Run("ImmutableRequiredParameterExists_MutableRequiredParameterAdded", func(t *testing.T) { t.Run("ImmutableRequiredParameterExists_MutableRequiredParameterAdded", func(t *testing.T) {