Use latest golangci-lint version (#1634)
## Description Use latest golangci-lint version. Also updates cache flags. ## Type of change <!--- Please check the type of change your PR introduces: ---> - [ ] 🌻 Feature - [ ] 🐛 Bugfix - [ ] 🗺️ Documentation - [ ] 🤖 Test - [x] 💻 CI/Deployment - [ ] 🐹 Trivial/Minor ## Issue(s) * #1629 ## Test Plan <!-- How will this be tested prior to merging.--> - [ ] 💪 Manual - [ ] ⚡ Unit test - [ ] 💚 E2E
This commit is contained in:
parent
bd373bbfd4
commit
c4333ad531
7
.github/workflows/ci.yml
vendored
7
.github/workflows/ci.yml
vendored
@ -324,9 +324,12 @@ jobs:
|
||||
- name: Go Lint
|
||||
uses: golangci/golangci-lint-action@v3
|
||||
with:
|
||||
version: v1.45.2
|
||||
# Keep pinned to a verson as sometimes updates will add new lint
|
||||
# failures in unchanged code.
|
||||
version: v1.50.1
|
||||
working-directory: src
|
||||
skip-cache: true
|
||||
skip-pkg-cache: true
|
||||
skip-build-cache: true
|
||||
|
||||
# check licenses
|
||||
- name: Get go-licenses
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
run:
|
||||
timeout: 15m
|
||||
build-tags:
|
||||
- testing
|
||||
timeout: 20m
|
||||
|
||||
linters:
|
||||
enable:
|
||||
@ -15,6 +13,11 @@ linters:
|
||||
- revive
|
||||
- wsl
|
||||
|
||||
disable:
|
||||
# Consumes a large amount of memory when running with Graph SDK in the
|
||||
# project causing OOM failures in Github actions.
|
||||
- staticcheck
|
||||
|
||||
linters-settings:
|
||||
gci:
|
||||
sections:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
# This must match the version defined in .github/workflows/lint.yaml.
|
||||
WANTED_LINT_VERSION := 1.45.2
|
||||
WANTED_LINT_VERSION := 1.50.1
|
||||
LINT_VERSION := $(shell golangci-lint version | cut -d' ' -f4)
|
||||
HAS_LINT := $(shell which golangci-lint)
|
||||
|
||||
|
||||
@ -89,8 +89,6 @@ func (suite *CommonTimeUnitSuite) TestExtractTime() {
|
||||
parseT("2006-01-02T03:00:04-01:00"),
|
||||
}
|
||||
|
||||
type timeFormatter func(time.Time) string
|
||||
|
||||
formats := []common.TimeFormat{
|
||||
common.ClippedSimple,
|
||||
common.ClippedSimpleOneDrive,
|
||||
|
||||
@ -282,9 +282,7 @@ func (suite *ConnectorCreateExchangeCollectionIntegrationSuite) TestMailFetch()
|
||||
require.NotEmpty(t, c.FullPath().Folder())
|
||||
folder := c.FullPath().Folder()
|
||||
|
||||
if _, ok := test.folderNames[folder]; ok {
|
||||
delete(test.folderNames, folder)
|
||||
}
|
||||
delete(test.folderNames, folder)
|
||||
}
|
||||
|
||||
assert.Empty(t, test.folderNames)
|
||||
@ -369,7 +367,7 @@ func (suite *ConnectorCreateExchangeCollectionIntegrationSuite) TestContactSeria
|
||||
assert.NotZero(t, read)
|
||||
contact, err := support.CreateContactFromBytes(buf.Bytes())
|
||||
assert.NotNil(t, contact)
|
||||
assert.NoError(t, err, "error on converting contact bytes: "+string(buf.Bytes()))
|
||||
assert.NoError(t, err, "error on converting contact bytes: "+buf.String())
|
||||
count++
|
||||
}
|
||||
assert.NotZero(t, count)
|
||||
@ -434,7 +432,7 @@ func (suite *ConnectorCreateExchangeCollectionIntegrationSuite) TestEventsSerial
|
||||
assert.NotZero(t, read)
|
||||
event, err := support.CreateEventFromBytes(buf.Bytes())
|
||||
assert.NotNil(t, event)
|
||||
assert.NoError(t, err, "experienced error parsing event bytes: "+string(buf.Bytes()))
|
||||
assert.NoError(t, err, "experienced error parsing event bytes: "+buf.String())
|
||||
}
|
||||
|
||||
status := connector.AwaitStatus()
|
||||
|
||||
@ -18,6 +18,7 @@ const (
|
||||
// The following functions are based off the code in v0.41.0 of msgraph-sdk-go
|
||||
// for sending delta requests with query parameters.
|
||||
|
||||
//nolint:unused
|
||||
func createGetRequestInformationWithRequestConfiguration(
|
||||
baseRequestInfoFunc func() (*abs.RequestInformation, error),
|
||||
requestConfig *DeltaRequestBuilderGetRequestConfiguration,
|
||||
@ -42,7 +43,7 @@ func createGetRequestInformationWithRequestConfiguration(
|
||||
return requestInfo, nil
|
||||
}
|
||||
|
||||
//nolint:deadcode
|
||||
//nolint:unused
|
||||
func sendMessagesDeltaGet(
|
||||
ctx context.Context,
|
||||
m *msmaildelta.DeltaRequestBuilder,
|
||||
@ -82,7 +83,7 @@ func sendMessagesDeltaGet(
|
||||
return res.(msmaildelta.DeltaResponseable), nil
|
||||
}
|
||||
|
||||
//nolint:deadcode
|
||||
//nolint:unused
|
||||
func sendContactsDeltaGet(
|
||||
ctx context.Context,
|
||||
m *mscontactdelta.DeltaRequestBuilder,
|
||||
|
||||
@ -233,7 +233,7 @@ func runRestoreBackupTest(
|
||||
assert.NotNil(t, deets)
|
||||
|
||||
status := restoreGC.AwaitStatus()
|
||||
runTime := time.Now().Sub(start)
|
||||
runTime := time.Since(start)
|
||||
|
||||
assert.Equal(t, totalItems, status.ObjectCount, "status.ObjectCount")
|
||||
assert.Equal(t, totalItems, status.Successful, "status.Successful")
|
||||
@ -268,7 +268,7 @@ func runRestoreBackupTest(
|
||||
dcs, err := backupGC.DataCollections(ctx, backupSel)
|
||||
require.NoError(t, err)
|
||||
|
||||
t.Logf("Backup enumeration complete in %v\n", time.Now().Sub(start))
|
||||
t.Logf("Backup enumeration complete in %v\n", time.Since(start))
|
||||
|
||||
// Pull the data prior to waiting for the status as otherwise it will
|
||||
// deadlock.
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
package sharepoint_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
|
||||
@ -55,7 +54,6 @@ func (ms *MockGraphService) ErrPolicy() bool {
|
||||
|
||||
type SharePointLibrariesSuite struct {
|
||||
suite.Suite
|
||||
ctx context.Context
|
||||
}
|
||||
|
||||
func TestSharePointLibrariesSuite(t *testing.T) {
|
||||
|
||||
@ -25,18 +25,22 @@ import (
|
||||
"github.com/alcionai/corso/src/pkg/storage"
|
||||
)
|
||||
|
||||
//nolint:unused
|
||||
func orgSiteSet(t *testing.T) []string {
|
||||
return tester.LoadTestM365OrgSites(t)
|
||||
}
|
||||
|
||||
//nolint:unused
|
||||
func orgUserSet(t *testing.T) []string {
|
||||
return tester.LoadTestM365OrgUsers(t)
|
||||
}
|
||||
|
||||
//nolint:unused
|
||||
func singleSiteSet(t *testing.T) []string {
|
||||
return []string{tester.LoadTestM365SiteID(t)}
|
||||
}
|
||||
|
||||
//nolint:unused
|
||||
func singleUserSet(t *testing.T) []string {
|
||||
return []string{tester.LoadTestM365UserID(t)}
|
||||
}
|
||||
@ -368,8 +372,8 @@ type RepositoryLoadTestExchangeSuite struct {
|
||||
suite.Suite
|
||||
ctx context.Context
|
||||
repo repository.Repository
|
||||
acct account.Account
|
||||
st storage.Storage
|
||||
acct account.Account //nolint:unused
|
||||
st storage.Storage //nolint:unused
|
||||
usersUnderTest []string
|
||||
}
|
||||
|
||||
@ -418,8 +422,8 @@ type RepositoryIndividualLoadTestExchangeSuite struct {
|
||||
suite.Suite
|
||||
ctx context.Context
|
||||
repo repository.Repository
|
||||
acct account.Account
|
||||
st storage.Storage
|
||||
acct account.Account //nolint:unused
|
||||
st storage.Storage //nolint:unused
|
||||
usersUnderTest []string
|
||||
}
|
||||
|
||||
@ -471,8 +475,8 @@ type RepositoryLoadTestOneDriveSuite struct {
|
||||
suite.Suite
|
||||
ctx context.Context
|
||||
repo repository.Repository
|
||||
acct account.Account
|
||||
st storage.Storage
|
||||
acct account.Account //nolint:unused
|
||||
st storage.Storage //nolint:unused
|
||||
usersUnderTest []string
|
||||
}
|
||||
|
||||
@ -518,8 +522,8 @@ type RepositoryIndividualLoadTestOneDriveSuite struct {
|
||||
suite.Suite
|
||||
ctx context.Context
|
||||
repo repository.Repository
|
||||
acct account.Account
|
||||
st storage.Storage
|
||||
acct account.Account //nolint:unused
|
||||
st storage.Storage //nolint:unused
|
||||
usersUnderTest []string
|
||||
}
|
||||
|
||||
@ -569,8 +573,8 @@ type RepositoryLoadTestSharePointSuite struct {
|
||||
suite.Suite
|
||||
ctx context.Context
|
||||
repo repository.Repository
|
||||
acct account.Account
|
||||
st storage.Storage
|
||||
acct account.Account //nolint:unused
|
||||
st storage.Storage //nolint:unused
|
||||
sitesUnderTest []string
|
||||
}
|
||||
|
||||
@ -616,8 +620,8 @@ type RepositoryIndividualLoadTestSharePointSuite struct {
|
||||
suite.Suite
|
||||
ctx context.Context
|
||||
repo repository.Repository
|
||||
acct account.Account
|
||||
st storage.Storage
|
||||
acct account.Account //nolint:unused
|
||||
st storage.Storage //nolint:unused
|
||||
sitesUnderTest []string
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user