golangci-lint: enable importas linter to force consistent aliases
This enforces the github.com/containerd/containerd/errdefs package to be aliased as "cerrdefs". Any other alias (or no alias used) results in a linting failure: integration/container/pause_test.go:9:2: import "github.com/containerd/containerd/errdefs" imported as "c8derrdefs" but must be "cerrdefs" according to config (importas) c8derrdefs "github.com/containerd/containerd/errdefs" ^ Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
81e62af94a
commit
f66374f6a8
1 changed files with 11 additions and 0 deletions
|
@ -5,6 +5,7 @@ linters:
|
|||
- gosec
|
||||
- gosimple
|
||||
- govet
|
||||
- importas
|
||||
- ineffassign
|
||||
- misspell
|
||||
- revive
|
||||
|
@ -24,6 +25,16 @@ linters:
|
|||
- docs
|
||||
|
||||
linters-settings:
|
||||
importas:
|
||||
# Do not allow unaliased imports of aliased packages.
|
||||
no-unaliased: true
|
||||
|
||||
alias:
|
||||
# Enforce alias to prevent it accidentally being used instead of our
|
||||
# own errdefs package (or vice-versa).
|
||||
- pkg: github.com/containerd/containerd/errdefs
|
||||
alias: cerrdefs
|
||||
|
||||
govet:
|
||||
check-shadowing: false
|
||||
depguard:
|
||||
|
|
Loading…
Reference in a new issue