vitess-gh/.golangci.yml

162 строки
4.0 KiB
YAML
Исходник Постоянная ссылка Обычный вид История

run:
go: 1.19
timeout: 10m
skip-dirs:
- go/vt/topo/k8stopo/client
linters-settings:
errcheck:
exclude: ./misc/errcheck_excludes.txt
goimports:
local-prefixes: vitess.io/vitess
govet:
disable: # not supported when using Generics in 1.18
- nilness
- unusedwrite
linters:
disable-all: true
enable:
# Defaults
- errcheck
- govet
- ineffassign
- typecheck
- staticcheck
- gosimple
# Extras
- gofmt
- goimports
- exportloopref
- bodyclose
# revive is a replacement for golint, but we do not run it in CI for now.
# This is only enabled as a post-commit hook
# - revive
issues:
exclude-rules:
- path: '^go/vt/proto/'
linters:
- errcheck
- goimports
[vtadmin] schema cache (#10120) * Initial generic backfill cache implementation for vtadmin Signed-off-by: Andrew Mason <andrew@planetscale.com> * disable structcheck for vtadmin/cache because it does not support generics yet Signed-off-by: Andrew Mason <andrew@planetscale.com> * Fix expiration semantics Signed-off-by: Andrew Mason <andrew@planetscale.com> * cache configs Signed-off-by: Andrew Mason <andrew@planetscale.com> * Stop taking bare strings in our cache layer Signed-off-by: Andrew Mason <andrew@planetscale.com> * let's give this a whirl Signed-off-by: Andrew Mason <andrew@planetscale.com> * log so we know we are using the cache Signed-off-by: Andrew Mason <andrew@planetscale.com> * refactor toward supporting GetSchemas Signed-off-by: Andrew Mason <andrew@planetscale.com> * refactor, support GetSchemas, add tracing annotations Signed-off-by: Andrew Mason <andrew@planetscale.com> * switch away from json.marshal, add log back Signed-off-by: Andrew Mason <andrew@planetscale.com> * hey dummy what if you actually filled the cache Signed-off-by: Andrew Mason <andrew@planetscale.com> * fix logic for determining when we need an additional backfill Signed-off-by: Andrew Mason <andrew@planetscale.com> * method extraction Signed-off-by: Andrew Mason <andrew@planetscale.com> * the Final Refactor :chefs-kiss: Signed-off-by: Andrew Mason <andrew@planetscale.com> * add some tests Signed-off-by: Andrew Mason <andrew@planetscale.com> * Add license headers, and some docs Signed-off-by: Andrew Mason <andrew@planetscale.com> * add config hook point Signed-off-by: Andrew Mason <andrew@planetscale.com> * start testing backfill logic -- i found a bug!! yay :lolsob: Signed-off-by: Andrew Mason <andrew@planetscale.com> * use unbuffered channel so we don't need a (potentially flaky) sleep Signed-off-by: Andrew Mason <andrew@planetscale.com> * more tests Signed-off-by: Andrew Mason <andrew@planetscale.com> * Install mechanism to propagate cache-refresh requests Signed-off-by: Andrew Mason <andrew@planetscale.com> * add Debug for caches Signed-off-by: Andrew Mason <andrew@planetscale.com> * Fix LoadOne to correctly handle not-found Signed-off-by: Andrew Mason <andrew@planetscale.com> * fix some data races Signed-off-by: Andrew Mason <andrew@planetscale.com> * Actually use the config Signed-off-by: Andrew Mason <andrew@planetscale.com> * more clones, also proto.Clone has weird 'zero value' vs nil behavior Signed-off-by: Andrew Mason <andrew@planetscale.com> * this test does not work if the cache has values Signed-off-by: Andrew Mason <andrew@planetscale.com> * punt on fixing api.TestGetSchemas Signed-off-by: Andrew Mason <andrew@planetscale.com> * Fix test setup for FindSchema to support backfill Signed-off-by: Andrew Mason <andrew@planetscale.com> * add io.Closer impls for api.API and cluster.Cluster Signed-off-by: Andrew Mason <andrew@planetscale.com> * finally, at long last, fix the racy tests for reals Signed-off-by: Andrew Mason <andrew@planetscale.com> * close clusters concurrently Signed-off-by: Andrew Mason <andrew@planetscale.com> * Just use a map to track lastFill times Signed-off-by: Andrew Mason <andrew@planetscale.com> * ctx/cancel->time.After Signed-off-by: Andrew Mason <andrew@planetscale.com> * Simpler Debug impl Signed-off-by: Andrew Mason <andrew@planetscale.com> * Remove unnecessary second Done() check Signed-off-by: Andrew Mason <andrew@planetscale.com> * PR feedback: reduce contention + add comments Signed-off-by: Andrew Mason <andrew@planetscale.com>
2022-05-22 13:26:37 +03:00
- path: '^go/vt/vtadmin/cache/'
linters:
- structcheck
### BEGIN: errcheck exclusion rules. Each rule should be considered
# a TODO for removal after adding error checks to that package/file/etc,
# except where otherwise noted.
- path: '^go/cmd/(vtcombo|vtgateclienttest|vtorc)/'
linters:
- errcheck
- path: '^go/mysql/'
linters:
- errcheck
- path: '^go/mysql/collations'
linters:
- revive
- path: '^go/pools/.*_test.go'
linters:
- errcheck
- path: '^go/sqltypes/'
linters:
- errcheck
- path: '^go/stats/statsd/'
linters:
- errcheck
- path: '^go/test/'
linters:
- errcheck
- path: '^go/vt/automation/'
linters:
- errcheck
- path: '^go/vt/mysqlctl/'
linters:
- errcheck
# (NB: @ajm188) Technically, the below `exclude-rules` for `go/vt/orchestrator/external` is
# redundant with this line, but we actually want to permanently ignore orchestrator's
# vendored code, so we are keeping the exclusion rules separate because this one
# should be temporary while the latter should be permanent.
- path: '^go/vt/orchestrator/'
linters:
- errcheck
# This subtree should be permanently excluded, as it's vendored code.
- path: '^go/vt/orchestrator/external/'
linters:
- errcheck
- path: '^go/vt/schemamanager/'
linters:
- errcheck
- path: '^go/vt/servenv/'
linters:
- errcheck
# This code is autogenerated and should be permanently excluded.
- path: '^go/vt/sqlparser/(ast_format|ast_format_fast).go'
linters:
- errcheck
- path: '^go/vt/sqlparser/goyacc'
linters:
- errcheck
- path: '^go/vt/throttler/.*_test.go'
linters:
- errcheck
- path: '^go/vt/topo/.*/*._test.go'
linters:
- errcheck
- path: '^go/vt/vtcombo/'
linters:
- errcheck
- path: '^go/vt/vtctl/[^/]*.go'
linters:
- errcheck
- path: '^go/vt/vtctl/grpcvtctlclient/'
linters:
- errcheck
- path: '^go/vt/vtctl/grpcvtctlserver/'
linters:
- errcheck
- path: '^go/vt/vtctld/(schema|.*_test).go'
linters:
- errcheck
- path: '^go/vt/vtexplain/'
linters:
- errcheck
- path: '^go/vt/vtgate/.*_test.go'
linters:
- errcheck
- path: '^go/vt/vtgr/'
linters:
- errcheck
- path: '^go/vt/vttablet/(customrule|filelogger|grpctmserver|onlineddl|sandboxconn|tabletserver)/'
linters:
- errcheck
- path: '^go/vt/vttablet/tabletmanager/vreplication'
linters:
- errcheck
- path: '^go/vt/vttablet/(.*endtoend.*|.*_test.go)'
linters:
- errcheck
- path: '^go/vt/vttest'
linters:
- errcheck
- path: '^go/vt/worker'
linters:
- errcheck
- path: '^go/vt/workflow'
linters:
- errcheck
- path: '^go/vt/wrangler'
linters:
- errcheck
- path: '^go/vt/zkctl'
linters:
- errcheck
### END: errcheck exclusion rules
# https://github.com/golangci/golangci/wiki/Configuration
service:
golangci-lint-version: 1.50.1 # use the fixed version to not introduce new linters unexpectedly