Files
tasks/.golangci.yml
David ReissandRoey Berman 8099eb88ec Refresh user data from db periodically (#6962)
## What changed?
The task queue user data owner reads from the db periodically after the
first read, to catch writes that may have been made by the old owner
during ownership change, or in general by any bugs.

## Why?
Membership isn't strongly consistent so an old owner of task queue user
data might complete or even start a write after a new owner has done its
initial read. This would be detected on an attempted update, but user
data is updated rarely so the stale data could persist for a long time.

## How did you test it?
new unit tests
2024-12-16 17:09:08 -08:00

127 lines
3.2 KiB
YAML

# https://golangci-lint.run/usage/configuration/#config-file
linters:
disable-all: true
enable:
- errcheck
- goimports
# - paralleltest # missing the call to method parallel, but testify does not seem to work well with parallel test: https://github.com/stretchr/testify/issues/187
- revive # revive supersedes golint, which is now archived
- staticcheck
- govet
- forbidigo
- exhaustive
- godox
issues:
exclude-dirs:
- ^api
- ^proto
- ^.git
exclude-rules:
- path-except: _test\.go|tests/.+\.go
text: "time.Sleep"
linters:
- forbidigo
- path: _test\.go|tests/.+\.go
text: "(cyclomatic|cognitive)" # false positives when using subtests
linters:
- revive
- path: _test\.go|tests/.+\.go
text: "(dot-imports|unchecked-type-assertion)" # helpful in tests
linters:
- revive
- path: ^tools\/.+\.go
linters:
- revive
linters-settings:
godox:
keywords:
- FIXME # marks TODOs that must be fixed before merging
govet:
fieldalignment: 0
forbidigo:
forbid:
- p: time.Sleep
msg: "Please use require.Eventually or assert.Eventually instead unless you've no other option"
- p: ^time\.After$
msg: "time.After may leak resources. Use time.NewTimer instead."
revive:
severity: error
confidence: 0.8
enable-all-rules: true
rules:
# Disabled rules
- name: add-constant
disabled: true
- name: argument-limit
disabled: true
- name: bare-return
disabled: true
- name: banned-characters
disabled: true
- name: bool-literal-in-expr
disabled: true
- name: confusing-naming
disabled: true
- name: empty-lines
disabled: true
- name: error-naming
disabled: true
- name: errorf
disabled: true
- name: exported
disabled: true
- name: file-header
disabled: true
- name: function-length
disabled: true
- name: imports-blacklist
disabled: true
- name: increment-decrement
disabled: true
- name: line-length-limit
disabled: true
- name: max-public-structs
disabled: true
- name: nested-structs
disabled: true
- name: package-comments
disabled: true
- name: string-format
disabled: true
- name: unexported-naming
disabled: true
- name: unexported-return
disabled: true
- name: unused-parameter
disabled: true
- name: unused-receiver
disabled: true
- name: use-any
disabled: true
- name: var-naming
disabled: true
- name: empty-block
disabled: true
- name: flag-parameter
disabled: true
- name: unnecessary-stmt
disabled: true
- name: range-val-in-closure
disabled: true
# Rule tuning
- name: cognitive-complexity
arguments:
- 25
- name: cyclomatic
arguments:
- 25
- name: function-result-limit
arguments:
- 5
- name: unhandled-error
arguments:
- "fmt.*"
- "bytes.Buffer.*"
- "strings.Builder.*"