Skip to content

Bump golangci/golangci-lint-action from 6 to 7 #350

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.go text eol=lf
7 changes: 1 addition & 6 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: golangci/golangci-lint-action@v6
if: ${{ matrix.os == 'windows-2019' }}
- uses: golangci/golangci-lint-action@v6
if: ${{ matrix.os != 'windows-2019' }}
with:
args: --enable goimports
- uses: golangci/golangci-lint-action@v7

test-unit: # <- name
strategy:
Expand Down
17 changes: 11 additions & 6 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# https://golangci-lint.run/usage/configuration/
run:
timeout: 5m # 1m default times out on github-action runners
version: "2"

output:
# Sort results by: filepath, line and column.
sort-results: true
linters:
default: standard

settings:
errcheck:
check-blank: true # assignment to blank identifier: `_ := someFunc()`.

formatters:
enable:
- goimports
3 changes: 1 addition & 2 deletions agent/action/action_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ package action_test

import (
"runtime"
"testing"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"testing"
)

const Windows = runtime.GOOS == "windows"
Expand Down
3 changes: 2 additions & 1 deletion agent/action/add_persistent_disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package action
import (
"errors"

boshsettings "github.com/cloudfoundry/bosh-agent/v2/settings"
bosherr "github.com/cloudfoundry/bosh-utils/errors"

boshsettings "github.com/cloudfoundry/bosh-agent/v2/settings"
)

type AddPersistentDiskAction struct {
Expand Down
5 changes: 3 additions & 2 deletions agent/action/add_persistent_disk_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package action

import (
"github.com/cloudfoundry/bosh-agent/v2/settings"
fakesettings "github.com/cloudfoundry/bosh-agent/v2/settings/fakes"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/pkg/errors"

"github.com/cloudfoundry/bosh-agent/v2/settings"
fakesettings "github.com/cloudfoundry/bosh-agent/v2/settings/fakes"
)

var _ = Describe("AddPersistentDiskAction", func() {
Expand Down
6 changes: 4 additions & 2 deletions agent/action/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ import (
"os"
"path"

bosherr "github.com/cloudfoundry/bosh-utils/errors"

boshappl "github.com/cloudfoundry/bosh-agent/v2/agent/applier"
boshas "github.com/cloudfoundry/bosh-agent/v2/agent/applier/applyspec"
boshsettings "github.com/cloudfoundry/bosh-agent/v2/settings"
bosherr "github.com/cloudfoundry/bosh-utils/errors"

"github.com/cloudfoundry/bosh-agent/v2/settings/directories"
boshsys "github.com/cloudfoundry/bosh-utils/system"

"github.com/cloudfoundry/bosh-agent/v2/settings/directories"
)

const (
Expand Down
5 changes: 3 additions & 2 deletions agent/action/apply_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

boshsys "github.com/cloudfoundry/bosh-utils/system"
fakesys "github.com/cloudfoundry/bosh-utils/system/fakes"

"github.com/cloudfoundry/bosh-agent/v2/agent/action"
boshas "github.com/cloudfoundry/bosh-agent/v2/agent/applier/applyspec"
fakeas "github.com/cloudfoundry/bosh-agent/v2/agent/applier/applyspec/fakes"
fakeappl "github.com/cloudfoundry/bosh-agent/v2/agent/applier/fakes"
boshsettings "github.com/cloudfoundry/bosh-agent/v2/settings"
boshdir "github.com/cloudfoundry/bosh-agent/v2/settings/directories"
fakesettings "github.com/cloudfoundry/bosh-agent/v2/settings/fakes"
boshsys "github.com/cloudfoundry/bosh-utils/system"
fakesys "github.com/cloudfoundry/bosh-utils/system/fakes"
)

var _ = Describe("ApplyAction", func() {
Expand Down
3 changes: 2 additions & 1 deletion agent/action/cancel_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package action
import (
"errors"

boshtask "github.com/cloudfoundry/bosh-agent/v2/agent/task"
bosherr "github.com/cloudfoundry/bosh-utils/errors"

boshtask "github.com/cloudfoundry/bosh-agent/v2/agent/task"
)

type CancelTaskAction struct {
Expand Down
5 changes: 3 additions & 2 deletions agent/action/compile_package.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package action
import (
"errors"

boshmodels "github.com/cloudfoundry/bosh-agent/v2/agent/applier/models"
boshcomp "github.com/cloudfoundry/bosh-agent/v2/agent/compiler"
boshcrypto "github.com/cloudfoundry/bosh-utils/crypto"
bosherr "github.com/cloudfoundry/bosh-utils/errors"

boshmodels "github.com/cloudfoundry/bosh-agent/v2/agent/applier/models"
boshcomp "github.com/cloudfoundry/bosh-agent/v2/agent/compiler"
)

type CompilePackageAction struct {
Expand Down
3 changes: 2 additions & 1 deletion agent/action/compile_package_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

boshcrypto "github.com/cloudfoundry/bosh-utils/crypto"

boshaction "github.com/cloudfoundry/bosh-agent/v2/agent/action"
boshmodels "github.com/cloudfoundry/bosh-agent/v2/agent/applier/models"
boshcomp "github.com/cloudfoundry/bosh-agent/v2/agent/compiler"
fakecomp "github.com/cloudfoundry/bosh-agent/v2/agent/compiler/fakes"
boshcrypto "github.com/cloudfoundry/bosh-utils/crypto"
)

func getCompileActionArguments() (blobID string, multiDigest boshcrypto.MultipleDigest, name, version string, deps boshcomp.Dependencies) {
Expand Down
5 changes: 3 additions & 2 deletions agent/action/compile_package_with_signed_url.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package action
import (
"errors"

boshmodels "github.com/cloudfoundry/bosh-agent/v2/agent/applier/models"
boshcomp "github.com/cloudfoundry/bosh-agent/v2/agent/compiler"
boshcrypto "github.com/cloudfoundry/bosh-utils/crypto"
bosherr "github.com/cloudfoundry/bosh-utils/errors"

boshmodels "github.com/cloudfoundry/bosh-agent/v2/agent/applier/models"
boshcomp "github.com/cloudfoundry/bosh-agent/v2/agent/compiler"
)

type CompilePackageWithSignedURLRequest struct {
Expand Down
3 changes: 2 additions & 1 deletion agent/action/compile_package_with_signed_url_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

boshcrypto "github.com/cloudfoundry/bosh-utils/crypto"

boshaction "github.com/cloudfoundry/bosh-agent/v2/agent/action"
boshmodels "github.com/cloudfoundry/bosh-agent/v2/agent/applier/models"
boshcomp "github.com/cloudfoundry/bosh-agent/v2/agent/compiler"
fakecomp "github.com/cloudfoundry/bosh-agent/v2/agent/compiler/fakes"
boshcrypto "github.com/cloudfoundry/bosh-utils/crypto"
)

func getCompileWithSignedURLActionArguments() boshaction.CompilePackageWithSignedURLRequest {
Expand Down
5 changes: 3 additions & 2 deletions agent/action/concrete_factory.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package action

import (
bosherr "github.com/cloudfoundry/bosh-utils/errors"
boshlog "github.com/cloudfoundry/bosh-utils/logger"

boshappl "github.com/cloudfoundry/bosh-agent/v2/agent/applier"
boshas "github.com/cloudfoundry/bosh-agent/v2/agent/applier/applyspec"
boshagentblob "github.com/cloudfoundry/bosh-agent/v2/agent/blobstore"
Expand All @@ -13,8 +16,6 @@ import (
boshnotif "github.com/cloudfoundry/bosh-agent/v2/notification"
boshplatform "github.com/cloudfoundry/bosh-agent/v2/platform"
boshsettings "github.com/cloudfoundry/bosh-agent/v2/settings"
bosherr "github.com/cloudfoundry/bosh-utils/errors"
boshlog "github.com/cloudfoundry/bosh-utils/logger"
)

type concreteFactory struct {
Expand Down
2 changes: 1 addition & 1 deletion agent/action/delete_arp_entries.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (a DeleteARPEntriesAction) IsLoggable() bool {
func (a DeleteARPEntriesAction) Run(args DeleteARPEntriesActionArgs) (interface{}, error) {
addresses := args.Ips
for _, address := range addresses {
_ = a.platform.DeleteARPEntryWithIP(address)
_ = a.platform.DeleteARPEntryWithIP(address) //nolint:errcheck
}

return map[string]interface{}{}, nil
Expand Down
5 changes: 3 additions & 2 deletions agent/action/drain.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ package action
import (
"errors"

bosherr "github.com/cloudfoundry/bosh-utils/errors"
boshlog "github.com/cloudfoundry/bosh-utils/logger"

boshas "github.com/cloudfoundry/bosh-agent/v2/agent/applier/applyspec"
boshscript "github.com/cloudfoundry/bosh-agent/v2/agent/script"
boshdrain "github.com/cloudfoundry/bosh-agent/v2/agent/script/drain"
boshjobsuper "github.com/cloudfoundry/bosh-agent/v2/jobsupervisor"
boshnotif "github.com/cloudfoundry/bosh-agent/v2/notification"
bosherr "github.com/cloudfoundry/bosh-utils/errors"
boshlog "github.com/cloudfoundry/bosh-utils/logger"
)

type DrainAction struct {
Expand Down
13 changes: 7 additions & 6 deletions agent/action/drain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"github.com/cloudfoundry/bosh-utils/crypto"
boshlog "github.com/cloudfoundry/bosh-utils/logger"

"github.com/cloudfoundry/bosh-agent/v2/agent/action"
boshas "github.com/cloudfoundry/bosh-agent/v2/agent/applier/applyspec"
fakeas "github.com/cloudfoundry/bosh-agent/v2/agent/applier/applyspec/fakes"
Expand All @@ -14,8 +17,6 @@ import (
"github.com/cloudfoundry/bosh-agent/v2/agent/script/scriptfakes"
fakejobsuper "github.com/cloudfoundry/bosh-agent/v2/jobsupervisor/fakes"
fakenotif "github.com/cloudfoundry/bosh-agent/v2/notification/fakes"
"github.com/cloudfoundry/bosh-utils/crypto"
boshlog "github.com/cloudfoundry/bosh-utils/logger"
)

var _ = Describe("DrainAction", func() {
Expand Down Expand Up @@ -131,7 +132,7 @@ var _ = Describe("DrainAction", func() {
jobScriptProvider.NewDrainScriptStub = func(jobName string, params boshdrain.ScriptParams) boshscript.CancellableScript {
Expect(params).To(Equal(boshdrain.NewUpdateParams(currentSpec, newSpec)))

if jobName == "foo" {
if jobName == "foo" { //nolint:staticcheck
return fooScript
} else if jobName == "bar" {
return barScript
Expand Down Expand Up @@ -244,7 +245,7 @@ var _ = Describe("DrainAction", func() {
jobScriptProvider.NewDrainScriptStub = func(jobName string, params boshdrain.ScriptParams) boshscript.CancellableScript {
Expect(params).To(Equal(boshdrain.NewShutdownParams(currentSpec, nil)))

if jobName == "foo" {
if jobName == "foo" { //nolint:staticcheck
return fooScript
} else if jobName == "bar" {
return barScript
Expand Down Expand Up @@ -325,12 +326,12 @@ var _ = Describe("DrainAction", func() {
})

It("does not unmonitor services ", func() {
_, _ = act()
_, _ = act() //nolint:errcheck
Expect(jobSupervisor.Unmonitored).To(BeFalse())
})

It("does not notify of job shutdown", func() {
_, _ = act()
_, _ = act() //nolint:errcheck
Expect(notifier.NotifiedShutdown).To(BeFalse())
})
})
Expand Down
2 changes: 1 addition & 1 deletion agent/action/fakes/fake_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (f *FakeFactory) Create(method string) (boshaction.Action, error) {
if action := f.registeredActions[method]; action != nil {
return action, nil
}
return nil, errors.New("Action not found")
return nil, errors.New("Action not found") //nolint:staticcheck
}

func (f *FakeFactory) RegisterAction(method string, action *TestAction) {
Expand Down
2 changes: 1 addition & 1 deletion agent/action/fetch_logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (a FetchLogsAction) Run(logTypes string, filters []string) (value map[strin
}

defer func() {
_ = a.logsTarProvider.CleanUp(tarball)
_ = a.logsTarProvider.CleanUp(tarball) //nolint:errcheck
}()

blobID, multidigestSha, err := a.blobstore.Write("", tarball, nil)
Expand Down
2 changes: 1 addition & 1 deletion agent/action/fetch_logs_with_signed_url.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (a FetchLogsWithSignedURLAction) Run(request FetchLogsWithSignedURLRequest)
}

defer func() {
_ = a.logsTarProvider.CleanUp(tarball)
_ = a.logsTarProvider.CleanUp(tarball) //nolint:errcheck
}()

_, digest, err := a.blobDelegator.Write(request.SignedURL, tarball, request.BlobstoreHeaders)
Expand Down
3 changes: 2 additions & 1 deletion agent/action/fetch_logs_with_signed_url_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package action_test
import (
"errors"

fakelogstarprovider "github.com/cloudfoundry/bosh-agent/v2/agent/logstarprovider/logstarproviderfakes"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

fakelogstarprovider "github.com/cloudfoundry/bosh-agent/v2/agent/logstarprovider/logstarproviderfakes"

boshassert "github.com/cloudfoundry/bosh-utils/assert"
boshcrypto "github.com/cloudfoundry/bosh-utils/crypto"

Expand Down
3 changes: 2 additions & 1 deletion agent/action/get_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package action
import (
"errors"

bosherr "github.com/cloudfoundry/bosh-utils/errors"

boshas "github.com/cloudfoundry/bosh-agent/v2/agent/applier/applyspec"
boshjobsuper "github.com/cloudfoundry/bosh-agent/v2/jobsupervisor"
boshvitals "github.com/cloudfoundry/bosh-agent/v2/platform/vitals"
boshsettings "github.com/cloudfoundry/bosh-agent/v2/settings"
bosherr "github.com/cloudfoundry/bosh-utils/errors"
)

type GetStateAction struct {
Expand Down
3 changes: 2 additions & 1 deletion agent/action/get_state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

boshassert "github.com/cloudfoundry/bosh-utils/assert"

"github.com/cloudfoundry/bosh-agent/v2/agent/action"
boshas "github.com/cloudfoundry/bosh-agent/v2/agent/applier/applyspec"
fakeas "github.com/cloudfoundry/bosh-agent/v2/agent/applier/applyspec/fakes"
Expand All @@ -15,7 +17,6 @@ import (
"github.com/cloudfoundry/bosh-agent/v2/platform/vitals/vitalsfakes"
boshsettings "github.com/cloudfoundry/bosh-agent/v2/settings"
fakesettings "github.com/cloudfoundry/bosh-agent/v2/settings/fakes"
boshassert "github.com/cloudfoundry/bosh-utils/assert"
)

var _ = Describe("GetState", func() {
Expand Down
3 changes: 2 additions & 1 deletion agent/action/get_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package action
import (
"errors"

boshtask "github.com/cloudfoundry/bosh-agent/v2/agent/task"
bosherr "github.com/cloudfoundry/bosh-utils/errors"

boshtask "github.com/cloudfoundry/bosh-agent/v2/agent/task"
)

type GetTaskAction struct {
Expand Down
3 changes: 2 additions & 1 deletion agent/action/get_task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

boshassert "github.com/cloudfoundry/bosh-utils/assert"

"github.com/cloudfoundry/bosh-agent/v2/agent/action"
boshtask "github.com/cloudfoundry/bosh-agent/v2/agent/task"
faketask "github.com/cloudfoundry/bosh-agent/v2/agent/task/fakes"
boshassert "github.com/cloudfoundry/bosh-utils/assert"
)

var _ = Describe("GetTask", func() {
Expand Down
4 changes: 3 additions & 1 deletion agent/action/info.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package action

import "errors"
import (
"errors"
)

type InfoAction struct{}

Expand Down
5 changes: 3 additions & 2 deletions agent/action/list_disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package action
import (
"errors"

boshplatform "github.com/cloudfoundry/bosh-agent/v2/platform"
boshsettings "github.com/cloudfoundry/bosh-agent/v2/settings"
bosherr "github.com/cloudfoundry/bosh-utils/errors"
boshlog "github.com/cloudfoundry/bosh-utils/logger"

boshplatform "github.com/cloudfoundry/bosh-agent/v2/platform"
boshsettings "github.com/cloudfoundry/bosh-agent/v2/settings"
)

type ListDiskAction struct {
Expand Down
Loading
Loading