Skip to content

Commit

Permalink
chore(linter): fix linter errors, remove deprecated allow leading spa…
Browse files Browse the repository at this point in the history
…ces (#163)

* chore(linter): fix linter errors, remove deprecated allow leading spaces

* chore(codeql): remove toolchain in go.mod to pass
  • Loading branch information
KellyMerrick authored Dec 13, 2023
1 parent fb772e5 commit dfaaf57
Show file tree
Hide file tree
Showing 15 changed files with 18 additions and 21 deletions.
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ linters-settings:

# https://github.com/golangci/golangci-lint/blob/master/pkg/golinters/nolintlint
nolintlint:
allow-leading-space: true # allow non-"machine-readable" format (ie. with leading space)
allow-unused: false # allow nolint directives that don't address a linting issue
require-explanation: true # require an explanation for nolint directives
require-specific: true # require nolint directives to be specific about which linter is being skipped
Expand Down
2 changes: 1 addition & 1 deletion cmd/vela-terraform/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func (a *Apply) Command() *exec.Cmd {

globalFlags = append(globalFlags, applyAction)

// nolint: gosec // ignore G204
//nolint:gosec // ignore G204
return exec.Command(_terraform, append(globalFlags, flags...)...)
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/vela-terraform/apply_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func TestTerraform_Apply_Command(t *testing.T) {
Version: v,
}

// nolint: gosec // ignore G204
//nolint:gosec // ignore G204
want := exec.Command(
_terraform,
fmt.Sprintf("-chdir=%s", a.Directory),
Expand Down Expand Up @@ -90,7 +90,7 @@ func TestTerraform_Apply_Command_tf13(t *testing.T) {
Version: v,
}

// nolint: gosec // ignore G204
//nolint:gosec // ignore G204
want := exec.Command(
_terraform,
applyAction,
Expand Down
2 changes: 1 addition & 1 deletion cmd/vela-terraform/destroy.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func (d *Destroy) Command() *exec.Cmd {

globalFlags = append(globalFlags, destroyAction)

// nolint: gosec // ignore G204
//nolint:gosec // ignore G204
return exec.Command(_terraform, append(globalFlags, flags...)...)
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/vela-terraform/destroy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestTerraform_Destroy_Command(t *testing.T) {
Version: v,
}

// nolint: gosec // ignore G204
//nolint:gosec // ignore G204
want := exec.Command(
_terraform,
fmt.Sprintf("-chdir=%s", d.Directory),
Expand Down Expand Up @@ -79,7 +79,7 @@ func TestTerraform_Destroy_Command_tf13(t *testing.T) {
Version: v,
}

// nolint: gosec // ignore G204
//nolint:gosec // ignore G204
want := exec.Command(
_terraform,
destroyAction,
Expand Down
2 changes: 1 addition & 1 deletion cmd/vela-terraform/fmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (f *FMT) Command() *exec.Cmd {

globalFlags = append(globalFlags, fmtAction)

// nolint: gosec // ignore G204
//nolint:gosec // ignore G204
return exec.Command(_terraform, append(globalFlags, flags...)...)
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/vela-terraform/fmt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestTerraform_FMT_Command(t *testing.T) {
Version: v,
}

// nolint: gosec // ignore G204
//nolint:gosec // ignore G204
want := exec.Command(
_terraform,
fmt.Sprintf("-chdir=%s", f.Directory),
Expand Down Expand Up @@ -52,7 +52,7 @@ func TestTerraform_FMT_Command_tf13(t *testing.T) {
Version: v,
}

// nolint: gosec // ignore G204
//nolint:gosec // ignore G204
want := exec.Command(
_terraform,
fmtAction,
Expand Down
2 changes: 1 addition & 1 deletion cmd/vela-terraform/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func (i *Init) Command() *exec.Cmd {

globalFlags = append(globalFlags, initAction)

// nolint: gosec // ignore G204
//nolint:gosec // ignore G204
return exec.Command(_terraform, append(globalFlags, flags...)...)
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/vela-terraform/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestTerraform_Init_Command(t *testing.T) {
},
}

// nolint: gosec // ignore G204
//nolint:gosec // ignore G204
want := exec.Command(
_terraform,
fmt.Sprintf("-chdir=%s", i.Directory),
Expand Down
2 changes: 1 addition & 1 deletion cmd/vela-terraform/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
_ "github.com/joho/godotenv/autoload"
)

// nolint: funlen // ignore function length due to comments and flags
//nolint:funlen // ignore function length due to comments and flags
func main() {
// capture application version information
v := version.New()
Expand Down
2 changes: 1 addition & 1 deletion cmd/vela-terraform/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func (p *Plan) Command() *exec.Cmd {

globalFlags = append(globalFlags, planAction)

// nolint: gosec // ignore G204
//nolint:gosec // ignore G204
return exec.Command(_terraform, append(globalFlags, flags...)...)
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/vela-terraform/plan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestTerraform_Plan_Command(t *testing.T) {
Version: v,
}

// nolint: gosec // ignore G204
//nolint:gosec // ignore G204
want := exec.Command(
_terraform,
fmt.Sprintf("-chdir=%s", p.Directory),
Expand Down Expand Up @@ -85,7 +85,7 @@ func TestTerraform_Plan_Command_tf13(t *testing.T) {
Version: v,
}

// nolint: gosec // ignore G204
//nolint:gosec // ignore G204
want := exec.Command(
_terraform,
planAction,
Expand Down
2 changes: 1 addition & 1 deletion cmd/vela-terraform/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (v *Validation) Command() *exec.Cmd {

globalFlags = append(globalFlags, validationAction)

// nolint: gosec // ignore G204
//nolint:gosec // ignore G204
return exec.Command(_terraform, append(globalFlags, flags...)...)
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/vela-terraform/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestTerraform_Validation_Command(t *testing.T) {
Version: ver,
}

// nolint: gosec // ignore G204
//nolint:gosec // ignore G204
want := exec.Command(
_terraform,
fmt.Sprintf("-chdir=%s", v.Directory),
Expand Down Expand Up @@ -54,7 +54,7 @@ func TestTerraform_Validation_Command_tf13(t *testing.T) {
Version: ver,
}

// nolint: gosec // ignore G204
//nolint:gosec // ignore G204
want := exec.Command(
_terraform,
validationAction,
Expand Down
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ module github.com/go-vela/vela-terraform

go 1.21

toolchain go1.21.5

require (
github.com/Masterminds/semver/v3 v3.2.1
github.com/go-vela/types v0.22.0
Expand Down

0 comments on commit dfaaf57

Please sign in to comment.