Skip to content

Commit cf3cad0

Browse files
committed
Fixed golangci-lint issues to improve code quality and maintainability.
Signed-off-by: Lorenzo Buitizon <the.keikun@gmail.com>
1 parent 40863c9 commit cf3cad0

78 files changed

Lines changed: 1878 additions & 1646 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cmd/tenv/subcmd.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import (
2929

3030
"github.com/spf13/cobra"
3131
"github.com/spf13/pflag"
32-
3332
"github.com/tofuutils/tenv/v4/config"
3433
"github.com/tofuutils/tenv/v4/pkg/loghelper"
3534
"github.com/tofuutils/tenv/v4/versionmanager"

cmd/tenv/tenv.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import (
2626

2727
"github.com/hashicorp/hcl/v2/hclparse"
2828
"github.com/spf13/cobra"
29-
3029
"github.com/tofuutils/tenv/v4/config"
3130
"github.com/tofuutils/tenv/v4/config/cmdconst"
3231
"github.com/tofuutils/tenv/v4/config/envname"

cmd/tenv/textui.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import (
2929
tea "github.com/charmbracelet/bubbletea"
3030
"github.com/charmbracelet/lipgloss"
3131
"github.com/hashicorp/hcl/v2/hclparse"
32-
3332
"github.com/tofuutils/tenv/v4/config"
3433
"github.com/tofuutils/tenv/v4/config/cmdconst"
3534
"github.com/tofuutils/tenv/v4/pkg/loghelper"

cmd/terramate/terramate_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ import (
2626
)
2727

2828
func TestTerramateMainPackage(t *testing.T) {
29+
t.Parallel()
30+
2931
// Test that the required constants are accessible
3032
assert.Equal(t, "terramate", cmdconst.TerramateName)
3133

@@ -35,6 +37,8 @@ func TestTerramateMainPackage(t *testing.T) {
3537
}
3638

3739
func TestTerramateConstants(t *testing.T) {
40+
t.Parallel()
41+
3842
tests := []struct {
3943
name string
4044
value string
@@ -49,6 +53,8 @@ func TestTerramateConstants(t *testing.T) {
4953

5054
for _, tt := range tests {
5155
t.Run(tt.name, func(t *testing.T) {
56+
t.Parallel()
57+
5258
assert.Equal(t, tt.expected, tt.value)
5359
})
5460
}

cmd/tf/tf_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
)
2727

2828
func TestTfMainPackage(t *testing.T) {
29+
t.Parallel()
2930
// Test that the required constants are accessible
3031
assert.Equal(t, "tf", cmdconst.AgnosticName)
3132

@@ -35,6 +36,7 @@ func TestTfMainPackage(t *testing.T) {
3536
}
3637

3738
func TestTfConstants(t *testing.T) {
39+
t.Parallel()
3840
tests := []struct {
3941
name string
4042
value string
@@ -49,6 +51,7 @@ func TestTfConstants(t *testing.T) {
4951

5052
for _, tt := range tests {
5153
t.Run(tt.name, func(t *testing.T) {
54+
t.Parallel()
5255
assert.Equal(t, tt.expected, tt.value)
5356
})
5457
}

config/cmdconst/constant.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
package cmdconst
2020

2121
const (
22-
// tools name.
22+
// AgnosticName tools name.
2323
AgnosticName = "tf"
2424
AtmosName = "atmos"
2525
TenvName = "tenv"
@@ -28,13 +28,13 @@ const (
2828
TerramateName = "terramate"
2929
TofuName = "tofu"
3030

31-
// full project name.
31+
// OpentofuName full project name.
3232
OpentofuName = "opentofu"
3333

34-
// hidden proxy sub command.
34+
// CallSubCmd hidden proxy sub command.
3535
CallSubCmd = "call"
3636

3737
BasicErrorExitCode = 1
38-
// exit code used by tenv proxy to signal a failure before the proxied command call.
38+
// EarlyErrorExitCode exit code used by tenv proxy to signal a failure before the proxied command call.
3939
EarlyErrorExitCode = 42
4040
)

config/cmdconst/constant_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
)
2626

2727
func TestCommandConstants(t *testing.T) {
28+
t.Parallel()
2829
tests := []struct {
2930
name string
3031
constant string
@@ -79,12 +80,14 @@ func TestCommandConstants(t *testing.T) {
7980

8081
for _, tt := range tests {
8182
t.Run(tt.name, func(t *testing.T) {
83+
t.Parallel()
8284
assert.Equal(t, tt.expected, tt.constant)
8385
})
8486
}
8587
}
8688

8789
func TestExitCodeConstants(t *testing.T) {
90+
t.Parallel()
8891
tests := []struct {
8992
name string
9093
constant int
@@ -104,6 +107,7 @@ func TestExitCodeConstants(t *testing.T) {
104107

105108
for _, tt := range tests {
106109
t.Run(tt.name, func(t *testing.T) {
110+
t.Parallel()
107111
assert.Equal(t, tt.expected, tt.constant)
108112
})
109113
}

config/config.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ import (
2727

2828
"github.com/fatih/color"
2929
"github.com/hashicorp/go-hclog"
30-
"gopkg.in/yaml.v3"
31-
3230
"github.com/tofuutils/tenv/v4/config/cmdconst"
3331
"github.com/tofuutils/tenv/v4/config/envname"
3432
configutils "github.com/tofuutils/tenv/v4/config/utils"
@@ -39,6 +37,7 @@ import (
3937
terragrunturl "github.com/tofuutils/tenv/v4/versionmanager/retriever/terragrunt/url"
4038
terramateurl "github.com/tofuutils/tenv/v4/versionmanager/retriever/terramate/url"
4139
tofuurl "github.com/tofuutils/tenv/v4/versionmanager/retriever/tofu/url"
40+
"gopkg.in/yaml.v3"
4241
)
4342

4443
const (

0 commit comments

Comments
 (0)