Fix staticcheck lint in CI (#1682)

## Description

Missed configuring working dir for staticcheck, plus fixes for errors reported.

## Type of change

<!--- Please check the type of change your PR introduces: --->
- [ ] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Test
- [x] 💻 CI/Deployment
- [ ] 🐹 Trivial/Minor

## Issue(s)

<!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. -->
* #<issue>

## Test Plan

<!-- How will this be tested prior to merging.-->
- [x] 💪 Manual
- [ ]  Unit test
- [ ] 💚 E2E
This commit is contained in:
Abin Simon 2022-12-08 13:56:27 +05:30 committed by GitHub
parent 6ee121a70a
commit 99f35eb5a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 16 deletions

View File

@ -362,6 +362,9 @@ jobs:
- name: Run staticcheck - name: Run staticcheck
uses: dominikh/staticcheck-action@v1.2.0 uses: dominikh/staticcheck-action@v1.2.0
with:
install-go: false
working-directory: src
# ---------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------

View File

@ -148,6 +148,7 @@ func runDisplayM365JSON(
fmt.Println(string(array)) fmt.Println(string(array))
//lint:ignore SA4004 only expecting one item
return nil return nil
} }

View File

@ -25,22 +25,22 @@ import (
"github.com/alcionai/corso/src/pkg/storage" "github.com/alcionai/corso/src/pkg/storage"
) )
//nolint:unused //lint:ignore U1000 future test use
func orgSiteSet(t *testing.T) []string { func orgSiteSet(t *testing.T) []string {
return tester.LoadTestM365OrgSites(t) return tester.LoadTestM365OrgSites(t)
} }
//nolint:unused //lint:ignore U1000 future test use
func orgUserSet(t *testing.T) []string { func orgUserSet(t *testing.T) []string {
return tester.LoadTestM365OrgUsers(t) return tester.LoadTestM365OrgUsers(t)
} }
//nolint:unused //lint:ignore U1000 future test use
func singleSiteSet(t *testing.T) []string { func singleSiteSet(t *testing.T) []string {
return []string{tester.LoadTestM365SiteID(t)} return []string{tester.LoadTestM365SiteID(t)}
} }
//nolint:unused //lint:ignore U1000 future test use
func singleUserSet(t *testing.T) []string { func singleUserSet(t *testing.T) []string {
return []string{tester.LoadTestM365UserID(t)} return []string{tester.LoadTestM365UserID(t)}
} }
@ -372,8 +372,8 @@ type RepositoryLoadTestExchangeSuite struct {
suite.Suite suite.Suite
ctx context.Context ctx context.Context
repo repository.Repository repo repository.Repository
acct account.Account //nolint:unused acct account.Account //lint:ignore U1000 future test use
st storage.Storage //nolint:unused st storage.Storage //lint:ignore U1000 future test use
usersUnderTest []string usersUnderTest []string
} }
@ -422,8 +422,8 @@ type RepositoryIndividualLoadTestExchangeSuite struct {
suite.Suite suite.Suite
ctx context.Context ctx context.Context
repo repository.Repository repo repository.Repository
acct account.Account //nolint:unused acct account.Account //lint:ignore U1000 future test use
st storage.Storage //nolint:unused st storage.Storage //lint:ignore U1000 future test use
usersUnderTest []string usersUnderTest []string
} }
@ -475,8 +475,8 @@ type RepositoryLoadTestOneDriveSuite struct {
suite.Suite suite.Suite
ctx context.Context ctx context.Context
repo repository.Repository repo repository.Repository
acct account.Account //nolint:unused acct account.Account //lint:ignore U1000 future test use
st storage.Storage //nolint:unused st storage.Storage //lint:ignore U1000 future test use
usersUnderTest []string usersUnderTest []string
} }
@ -522,8 +522,8 @@ type RepositoryIndividualLoadTestOneDriveSuite struct {
suite.Suite suite.Suite
ctx context.Context ctx context.Context
repo repository.Repository repo repository.Repository
acct account.Account //nolint:unused acct account.Account //lint:ignore U1000 future test use
st storage.Storage //nolint:unused st storage.Storage //lint:ignore U1000 future test use
usersUnderTest []string usersUnderTest []string
} }
@ -573,8 +573,8 @@ type RepositoryLoadTestSharePointSuite struct {
suite.Suite suite.Suite
ctx context.Context ctx context.Context
repo repository.Repository repo repository.Repository
acct account.Account //nolint:unused acct account.Account //lint:ignore U1000 future test use
st storage.Storage //nolint:unused st storage.Storage //lint:ignore U1000 future test use
sitesUnderTest []string sitesUnderTest []string
} }
@ -620,8 +620,8 @@ type RepositoryIndividualLoadTestSharePointSuite struct {
suite.Suite suite.Suite
ctx context.Context ctx context.Context
repo repository.Repository repo repository.Repository
acct account.Account //nolint:unused acct account.Account //lint:ignore U1000 future test use
st storage.Storage //nolint:unused st storage.Storage //lint:ignore U1000 future test use
sitesUnderTest []string sitesUnderTest []string
} }

1
src/staticcheck.conf Normal file
View File

@ -0,0 +1 @@
dot_import_whitelist = ["github.com/alcionai/corso/src/cli/print"]