Skip to content

Commit

Permalink
chore: Update golangci-lint version and add some new linters (#509)
Browse files Browse the repository at this point in the history
Co-authored-by: jb-abbadie <jb-abbadie@users.noreply.github.com>
  • Loading branch information
jb-abbadie and jb-abbadie authored Jan 20, 2025
1 parent df68854 commit a063546
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 18 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/golangci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,4 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.57.2

version: v1.63.4
37 changes: 22 additions & 15 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,26 @@ run:

linters:
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- deadcode
- containedctx
- copyloopvar
- cyclop
- decorder
- dogsled
- dupl
- dupword
- durationcheck
- errcheck
- errchkjson
- errname
- errorlint
- exportloopref
- exhaustive
- exptostd
- forcetypeassert
- fatcontext
- gochecknoinits
- goconst
- gocritic
Expand All @@ -25,38 +34,31 @@ linters:
- gomoddirectives
- gomodguard
- goprintffuncname
- gosec
- gosimple
- govet
- importas
- ineffassign
- makezero
- misspell
- nakedret
- nilerr
- predeclared
- promlinter
- rowserrcheck
- sqlclosecheck
- structcheck
- testpackage
- thelper
- tparallel
- typecheck
- unused
- varcheck
- whitespace
- gosec
- forcetypeassert
- cyclop
- exhaustive
- govet
- nilerr
- wastedassign
- ineffassign
- whitespace
disable:
# Should be readded in the future with a dedicated PR to do the fix
- depguard
- funlen
- gocognit
- gofumpt
- ifshort
- nestif
- nolintlint
- revive
Expand All @@ -66,8 +68,13 @@ linters:
- unparam

# Disabled with a reason
- canonicalheader # Clickhouse uses non-canonical header
- depguard # Way too spammy and forces whitelist of all imports
- gochecknoglobals # incompatible with the way we define our flags currently
- maligned # checker not supported anymore
- noctx # disabled because we do not plan to distribute this code as a library
- prealloc # we are not after some perf
- tagliatelle # disabled because we are dependant on external API that do not follow the right naming
linters-settings:
gosec:
excludes:
- G115 # Unsafe cast of ints. Needs to be looked at by a dedicated PR
2 changes: 1 addition & 1 deletion proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ func (rp *reverseProxy) serveFromCache(s *scope, srw *statResponseWriter, req *h
log.Debugf("%s: cache miss after awaiting concurrent query", s)
}
} else if transactionStatus.State.IsFailed() {
respondWith(srw, fmt.Errorf(transactionStatus.FailReason), http.StatusInternalServerError)
respondWith(srw, fmt.Errorf("%v", transactionStatus.FailReason), http.StatusInternalServerError)
return
}
}
Expand Down

0 comments on commit a063546

Please sign in to comment.