Skip to content

Commit

Permalink
chore: upgrade go and golangci-lint versions
Browse files Browse the repository at this point in the history
  • Loading branch information
kulti committed Feb 7, 2024
1 parent 6431946 commit d35e8f1
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 25 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: ^1.18
go-version: ^1.21
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.45.2
version: v1.56.0

tests:
runs-on: ubuntu-18.04
Expand All @@ -27,7 +27,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.18
go-version: ^1.21
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
Expand All @@ -45,7 +45,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.18
go-version: ^1.21
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
Expand Down
46 changes: 28 additions & 18 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,35 @@ linters-settings:
locale: US
gci:
local-prefixes: github.com/kulti/thelper
nolintlint:
require-explanation: true
require-specific: true

linters:
enable-all: true
disable:
- lll
- prealloc
- dupl
- wsl
- nlreturn
- goerr113
- exhaustivestruct
- paralleltest
- gomnd
- gocognit
- nestif
- varnamelen
- interfacer
- maligned
- scopelint
- golint
- cyclop
- nilnil
- cyclop
- deadcode # deprecated
- depguard # Not looks useful for this project
- dupl
- exhaustivestruct # deprecated
- exhaustruct # Make use of zero-values and partial initialization.
- gocognit
- goerr113
- golint
- gomnd
- ifshort # deprecated
- interfacer
- lll
- maligned
- nestif
- nilnil
- nlreturn
- nosnakecase # deprecated
- paralleltest
- prealloc
- scopelint
- structcheck # deprecated
- varcheck # deprecated
- varnamelen
- wsl
8 changes: 5 additions & 3 deletions pkg/analyzer/analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ import (
)

const (
doc = "thelper detects tests helpers which is not start with t.Helper() method."
doc = "thelper detects tests helpers which is not start with t.Helper() method."

//nolint:goconst // Just a repeated coma, cannot be write better.
checksDoc = `coma separated list of enabled checks
Available checks
Expand Down Expand Up @@ -254,7 +256,7 @@ func (t thelper) buildTestCheckFuncOpts(pass *analysis.Pass, ctxType types.Type)
fnHelper: tHelper,
subRun: tRun,
hpType: tType,
subTestFuncType: types.NewSignature(nil, types.NewTuple(tVar), nil, false),
subTestFuncType: types.NewSignatureType(nil, nil, nil, types.NewTuple(tVar), nil, false),
ctxType: ctxType,
checkBegin: t.enabledChecks.Enabled(checkTBegin),
checkFirst: t.enabledChecks.Enabled(checkTFirst),
Expand Down Expand Up @@ -315,7 +317,7 @@ func (t thelper) buildBenchmarkCheckFuncOpts(pass *analysis.Pass, ctxType types.
fnHelper: bHelper,
subRun: bRun,
hpType: types.NewPointer(bObj.Type()),
subTestFuncType: types.NewSignature(nil, types.NewTuple(bVar), nil, false),
subTestFuncType: types.NewSignatureType(nil, nil, nil, types.NewTuple(bVar), nil, false),
ctxType: ctxType,
checkBegin: t.enabledChecks.Enabled(checkBBegin),
checkFirst: t.enabledChecks.Enabled(checkBFirst),
Expand Down
1 change: 1 addition & 0 deletions scripts/generator/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"text/template"
)

//nolint:dupword // false positive about double `type`
const tTmpl = `// Code generated by generator. DO NOT EDIT.
package {{$.Name}}
Expand Down

0 comments on commit d35e8f1

Please sign in to comment.