Skip to content

Commit

Permalink
Bump golangci-lint to v1.55.1 (#110)
Browse files Browse the repository at this point in the history
- Use latest release as of today:
https://github.com/golangci/golangci-lint/releases/tag/v1.55.1
- Update golangci-lint configuration using `connect-go` as base
  • Loading branch information
unmultimedio authored Oct 27, 2023
1 parent 7d5c4a5 commit cc22bc3
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 51 deletions.
91 changes: 43 additions & 48 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,52 +9,47 @@ linters-settings:
- '^log\.'
- '^print$'
- '^println$'
- '^panic$'
godox:
# TODO, OPT, etc. comments are fine to commit. Use FIXME comments for
# temporary hacks, and use godox to prevent committing them.
keywords: [FIXME]
importas:
no-unaliased: true
varnamelen:
ignore-decls:
- T any
- i int
- wg sync.WaitGroup
linters:
enable:
- asciicheck
- bidichk
- bodyclose
- containedctx
- contextcheck
- decorder
# - depguard
- dogsled
- errcheck
- execinquery
- exportloopref
- forbidigo
- forcetypeassert
- gochecknoinits
- gofmt
- goheader
- goimports
- gomodguard
- goprintffuncname
- gosec
- gosimple
- gosmopolitan
- govet
- grouper
- importas
- ineffassign
- interfacebloat
- logrlint
- makezero
- mirror
- misspell
- nakedret
- nilerr
- nolintlint
- nosprintfhostport
- predeclared
- promlinter
- reassign
- rowserrcheck
- staticcheck
- stylecheck
- typecheck
- unconvert
- unused
- wastedassign
- whitespace
disable-all: true
enable-all: true
disable:
- cyclop # covered by gocyclo
- deadcode # abandoned
- depguard # newer versions require explicit config to depend on anything outside of the Go stdlib
- exhaustivestruct # replaced by exhaustruct
- funlen # rely on code review to limit function length
- gocognit # dubious "cognitive overhead" quantification
- gofumpt # prefer standard gofmt
- goimports # rely on gci instead
- golint # deprecated by Go team
- gomnd # some unnamed constants are okay
- ifshort # deprecated by author
- interfacer # deprecated by author
- ireturn # "accept interfaces, return structs" isn't ironclad
- lll # don't want hard limits for line length
- maintidx # covered by gocyclo
- maligned # readability trumps efficient struct packing
- nlreturn # generous whitespace violates house style
- nosnakecase # deprecated in https://github.com/golangci/golangci-lint/pull/3065
- scopelint # deprecated by author
- structcheck # abandoned
- testpackage # internal tests are fine
- varcheck # abandoned
- wrapcheck # don't _always_ need to wrap errors
- wsl # generous whitespace violates house style
issues:
exclude:
# Don't ban use of fmt.Errorf to create new errors, but the remaining
# checks from err113 are useful.
- "err113: do not define dynamic errors.*"
1 change: 1 addition & 0 deletions internal/foo/foo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ import (
)

func TestBar(t *testing.T) {
t.Parallel()
assert.Equal(t, "bar", Bar())
}
6 changes: 3 additions & 3 deletions make/go/dep_golangci_lint.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ $(call _assert_var,CACHE_VERSIONS)
$(call _assert_var,CACHE_BIN)

# Settable
# https://github.com/golangci/golangci-lint/releases 20230821 checked 20230828
# Check for new linters and add to .golangci.yml (even if commented out) when upgrading
GOLANGCI_LINT_VERSION ?= v1.54.2
# https://github.com/golangci/golangci-lint/releases 20231025 checked 20231027
# Contrast golangci-lint configuration with the one in https://github.com/connectrpc/connect-go/blob/main/.golangci.yml when upgrading
GOLANGCI_LINT_VERSION ?= v1.55.1

GOLANGCI_LINT := $(CACHE_VERSIONS)/golangci-lint/$(GOLANGCI_LINT_VERSION)
$(GOLANGCI_LINT):
Expand Down

0 comments on commit cc22bc3

Please sign in to comment.