From 56a2f8455f023c693111b6da9e935b92ad25ab7e Mon Sep 17 00:00:00 2001 From: Marko Date: Sat, 9 May 2020 08:52:01 +0200 Subject: [PATCH] change ci linter (#92) --- .github/workflows/lint.yml | 14 +++++++------- .golangci.yml | 1 + common_test.go | 6 +++--- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e0bfa0f683f..ba6a65c378f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -4,15 +4,15 @@ on: branches: - master pull_request: + jobs: - golangci-lint: - name: runner / golangci-lint + golangci: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: golangci-lint - uses: reviewdog/action-golangci-lint@v1 - # uses: docker://reviewdog/action-golangci-lint:v1 # pre-build docker image + - uses: golangci/golangci-lint-action@master with: - github_token: ${{ secrets.github_token }} - reporter: github-pr-check + # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. + version: v1.26 + args: --timeout 10m + github-token: ${{ secrets.github_token }} diff --git a/.golangci.yml b/.golangci.yml index 46fa45f6002..4feb4c55d07 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -39,6 +39,7 @@ linters: # - whitespace # - wsl # - gocognit + - nolintlint linters-settings: maligned: diff --git a/common_test.go b/common_test.go index aa903a5da46..766b3cbfad5 100644 --- a/common_test.go +++ b/common_test.go @@ -26,7 +26,7 @@ func checkValid(t *testing.T, itr Iterator, expected bool) { } func checkNext(t *testing.T, itr Iterator, expected bool) { - itr.Next() // nolint:errcheck + itr.Next() // assert.NoError(t, err) TODO: look at fixing this valid := itr.Valid() require.Equal(t, expected, valid) @@ -120,7 +120,7 @@ func benchmarkRandomReadsWrites(b *testing.B, db DB) { for i := 0; i < b.N; i++ { // Write something { - idx := rand.Int63n(numItems) // nolint:gosec testing file, so accepting weak random number generator + idx := rand.Int63n(numItems) internal[idx]++ val := internal[idx] idxBytes := int642Bytes(idx) @@ -135,7 +135,7 @@ func benchmarkRandomReadsWrites(b *testing.B, db DB) { // Read something { - idx := rand.Int63n(numItems) // nolint:gosec testing file, so accepting weak random number generator + idx := rand.Int63n(numItems) valExp := internal[idx] idxBytes := int642Bytes(idx) valBytes, err := db.Get(idxBytes)