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 (#103)
  • Loading branch information
KellyMerrick committed Dec 13, 2023
1 parent 1ac5ef4 commit fb8ffc4
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 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
5 changes: 3 additions & 2 deletions cmd/vela-docker/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,8 @@ var buildFlags = []cli.Flag{

// Command formats and outputs the Build command from
// the provided configuration to build a Docker image.
// nolint:funlen,gocyclo // Ignore line length
//
//nolint:funlen,gocyclo // Ignore line length
func (b *Build) Command() *exec.Cmd {
logrus.Trace("creating docker build command from plugin configuration")

Expand Down Expand Up @@ -555,7 +556,7 @@ func (b *Build) Command() *exec.Cmd {
// add the required directory param
flags = append(flags, b.Context)

// nolint:gosec // this functionality is not exploitable the way
//nolint:gosec // this functionality is not exploitable the way
// the plugin accepts configuration
return exec.Command(_docker, append([]string{buildAction}, flags...)...)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/vela-docker/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func TestDocker_Build_Command(t *testing.T) {
Ulimits: []string{"1"},
}

// nolint:gosec // this functionality is not exploitable the way
//nolint:gosec // this functionality is not exploitable the way
// the plugin accepts configuration
want := exec.Command(
_docker,
Expand Down
2 changes: 1 addition & 1 deletion cmd/vela-docker/daemon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestDocker_Daemon_Command(t *testing.T) {
},
}

// nolint:gosec // this functionality is not exploitable the way
//nolint:gosec // this functionality is not exploitable the way
// the plugin accepts configuration
want := exec.Command(
_dockerd,
Expand Down
2 changes: 1 addition & 1 deletion cmd/vela-docker/plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"
)

func TestDocker_Plugin_Exec(t *testing.T) {
func TestDocker_Plugin_Exec(_ *testing.T) {
// TODO Write test
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/vela-docker/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (p *Push) Command() *exec.Cmd {
// add tag to command
flags = append(flags, p.Tag)

// nolint: gosec // this functionality is not exploitable the way
//nolint: gosec // this functionality is not exploitable the way
// the plugin accepts configuration
return exec.Command(_docker, append([]string{pushAction}, flags...)...)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/vela-docker/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func (r *Registry) Login() error {
// add flag for registry name
flags = append(flags, r.Name)

// nolint: gosec // ignore executing command as subprocess
//nolint: gosec // ignore executing command as subprocess
e := exec.Command(_docker, append([]string{loginAction}, flags...)...)

// set command stdout to OS stdout
Expand Down

0 comments on commit fb8ffc4

Please sign in to comment.