Skip to content

Commit

Permalink
ci: update golangci-lint to v1.58.1
Browse files Browse the repository at this point in the history
While there, remove deprecated linters and enable new linters.

Signed-off-by: Robin Hahling <[email protected]>
  • Loading branch information
rolinh committed May 10, 2024
1 parent f0eb9f9 commit bdb99e8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
- name: Run golangci lint
uses: golangci/golangci-lint-action@38e1018663fa5173f3968ea0777460d3de38f256
with:
version: v1.53.3
version: v1.58.1
# use our .golangci.yml and configure output to be logged in the GHA,
# in addition to annotating the commit. see
# https://github.com/golangci/golangci-lint-action/issues/119#issuecomment-981090648
Expand Down
13 changes: 9 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ linters:
- bodyclose
- containedctx
- contextcheck
- copyloopvar
- decorder
- dogsled
- dupl
- dupword
- durationcheck
- errchkjson
- err113
- errcheck
- errchkjson
- errname
- errorlint
- exhaustive
Expand All @@ -29,18 +31,18 @@ linters:
- goconst
- gocritic
- godot
- goerr113
- gofmt
- goheader
- goimports
- gomnd
- goprintffuncname
- gosec
- gosimple
- govet
- grouper
- importas
- ineffassign
- interfacebloat
- intrange
- ireturn
- makezero
- mirror
Expand All @@ -51,14 +53,17 @@ linters:
- nilerr
- noctx
- nosprintfhostport
- perfsprint
- prealloc
- predeclared
- reassign
- revive
- rowserrcheck
- sloglint
- staticcheck
- tagalign
- tenv
- testifylint
- thelper
- tparallel
- typecheck
Expand Down Expand Up @@ -87,5 +92,5 @@ linters-settings:
issues:
exclude-use-default: false # default rules exclude doc comments check :(
exclude-rules:
- linters: [goerr113]
- linters: [err113]
text: "do not define dynamic errors, use wrapped static errors instead"
3 changes: 2 additions & 1 deletion ioreadall/io_readall.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package ioreadall

import (
"errors"
"fmt"
"go/ast"
"strings"
Expand Down Expand Up @@ -38,7 +39,7 @@ func init() {
func run(pass *analysis.Pass) (interface{}, error) {
inspct, ok := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector)
if !ok {
return nil, fmt.Errorf("analyzer is not type *inspector.Inspector")
return nil, errors.New("analyzer is not type *inspector.Inspector")
}

ignoreMap := make(map[string]struct{})
Expand Down
3 changes: 2 additions & 1 deletion timeafter/time_after.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package timeafter

import (
"errors"
"fmt"
"go/ast"
"strings"
Expand Down Expand Up @@ -46,7 +47,7 @@ func (v visitor) Visit(node ast.Node) ast.Visitor {
func run(pass *analysis.Pass) (interface{}, error) {
inspct, ok := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector)
if !ok {
return nil, fmt.Errorf("analyzer is not type *inspector.Inspector")
return nil, errors.New("analyzer is not type *inspector.Inspector")
}

ignoreMap := make(map[string]struct{})
Expand Down

0 comments on commit bdb99e8

Please sign in to comment.