Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 53 additions & 43 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,65 +1,75 @@
version: "2"
run:
deadline: 1m
tests: false
issues:
exclude-files:
- ".*\\.pb\\.go$"
- ".*\\.pb\\.gw\\.go$"
- ".*\\.gen\\.go$"
- "_test\\.go$"
- "testing.go$"
- ".*doc\\.go$"

linters-settings:
golint:
min-confidence: 0
maligned:
suggest-new: true
misspell:
locale: US
gci:
sections:
- standard
- default
- prefix(berty.tech)
# - prefix(github.com/libp2p)
# - prefix(github.com/ipfs)

linters:
disable-all: true
default: none
enable:
- asciicheck
- bodyclose
#- depguard
- dogsled
- errcheck
#- exhaustive # nice to have
- exportloopref
- gci
- gochecknoinits
#- gocognit # nice to have
#- goconst
- gocritic
#- godot # nice to have
#- goerr113 # nice to have
- gofmt
- gofumpt
- goimports
- revive
#- gomnd # nice to have
- gomodguard
- gosec
- gosimple
- govet
- ineffassign
- misspell
- nakedret
- noctx
#- nolintlint
- exportloopref
- revive
- staticcheck
- typecheck
- unconvert
- unparam
- unused
- whitespace
settings:
misspell:
locale: US
gosec:
excludes:
# G115 (integer overflow on conversion) is too noisy: it flags many
# safe conversions in serialization and utility code (protobuf message
# lengths, unix timestamps, peer counts, ...).
- G115
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
- .*\.pb\.go$
- .*\.pb\.gw\.go$
- .*\.gen\.go$
- _test\.go$
- testing.go$
- .*doc\.go$
- third_party$
- builtin$
- examples$
formatters:
enable:
- gci
- gofmt
- gofumpt
- goimports
settings:
gci:
sections:
- standard
- default
- prefix(berty.tech)
exclusions:
generated: lax
paths:
- .*\.pb\.go$
- .*\.pb\.gw\.go$
- .*\.gen\.go$
- _test\.go$
- testing.go$
- .*doc\.go$
- third_party$
- builtin$
- examples$
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
# major version of Go which is allowed by kubo.
# There is no contraindication for updating it.
#-----
golang 1.22.5
golang 1.26.4

#-----
# This is simply the most recent golangci-lint version available to date.
#-----
golangci-lint 1.59.1
golangci-lint 2.12.2

#-----
# This is simply the most recent jq version available to date.
Expand Down
2 changes: 1 addition & 1 deletion contact_request_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ func (c *contactRequestsManager) registerContactLookup(ctx context.Context, cont
key := hex.EncodeToString(contactPK)

// make sure to only have one process for this pk running
ctx, cancel := context.WithCancel(ctx)
ctx, cancel := context.WithCancel(ctx) //nolint:gosec // cancel is stored in c.lookupProcess and called by cancelContactLookup
if cancelProvious, ok := c.lookupProcess[key]; ok {
cancelProvious() // cancel previous lookup if needed
}
Expand Down
Loading
Loading