mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
ci: lint against dupl (#9357)
This lint rule should help us keep Go code redundancy under control.
This commit is contained in:
@@ -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
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user