2023-04-17 23:38:24 +01:00
|
|
|
linters:
|
|
|
|
# Don't enable any linters by default; just the ones that we explicitly
|
|
|
|
# enable in the list below.
|
|
|
|
disable-all: true
|
|
|
|
enable:
|
2023-04-20 02:54:19 +01:00
|
|
|
- bidichk
|
2023-04-17 23:38:24 +01:00
|
|
|
- gofmt
|
|
|
|
- goimports
|
|
|
|
- misspell
|
2023-04-20 02:54:19 +01:00
|
|
|
- revive
|
2023-04-17 23:38:24 +01:00
|
|
|
|
|
|
|
# Configuration for how we run golangci-lint
|
|
|
|
run:
|
|
|
|
timeout: 5m
|
|
|
|
|
|
|
|
issues:
|
|
|
|
# Excluding configuration per-path, per-linter, per-text and per-source
|
|
|
|
exclude-rules:
|
|
|
|
# These are forks of an upstream package and thus are exempt from stylistic
|
|
|
|
# changes that would make pulling in upstream changes harder.
|
|
|
|
- path: tempfork/.*\.go
|
|
|
|
text: "File is not `gofmt`-ed with `-s` `-r 'interface{} -> any'`"
|
|
|
|
- path: util/singleflight/.*\.go
|
|
|
|
text: "File is not `gofmt`-ed with `-s` `-r 'interface{} -> any'`"
|
|
|
|
|
|
|
|
# Per-linter settings are contained in this top-level key
|
|
|
|
linters-settings:
|
2023-04-20 02:54:19 +01:00
|
|
|
# Enable all rules by default; we don't use invisible unicode runes.
|
|
|
|
bidichk:
|
|
|
|
|
2023-04-17 23:38:24 +01:00
|
|
|
gofmt:
|
|
|
|
rewrite-rules:
|
|
|
|
- pattern: 'interface{}'
|
|
|
|
replacement: 'any'
|
|
|
|
|
|
|
|
goimports:
|
|
|
|
|
|
|
|
misspell:
|
2023-04-20 02:54:19 +01:00
|
|
|
|
|
|
|
revive:
|
|
|
|
enable-all-rules: false
|
|
|
|
ignore-generated-header: true
|
|
|
|
rules:
|
|
|
|
- name: atomic
|
|
|
|
- name: context-keys-type
|
|
|
|
- name: defer
|
|
|
|
arguments: [[
|
|
|
|
# Calling 'recover' at the time a defer is registered (i.e. "defer recover()") has no effect.
|
|
|
|
"immediate-recover",
|
|
|
|
# Calling 'recover' outside of a deferred function has no effect
|
|
|
|
"recover",
|
|
|
|
# Returning values from a deferred function has no effect
|
|
|
|
"return",
|
|
|
|
]]
|
|
|
|
- name: duplicated-imports
|
|
|
|
- name: errorf
|
|
|
|
- name: string-of-int
|
|
|
|
- name: time-equal
|
|
|
|
- name: unconditional-recursion
|
|
|
|
- name: useless-break
|
|
|
|
- name: waitgroup-by-value
|