Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass depguard test #860

Merged
merged 1 commit into from
Sep 26, 2023
Merged
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
87 changes: 65 additions & 22 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
run:
timeout: 10m

Expand All @@ -6,24 +7,24 @@ linters:
enable:
- asciicheck
- bodyclose
#- cyclop # TODO: Reduce code complexity.
# - cyclop # TODO: Reduce code complexity.
- depguard
- dogsled
#- dupl # TODO: Remove duplicates.
# - dupl # TODO: Remove duplicates.
- durationcheck
#- errcheck # TODO: Not all received errors are checked.
#- errorlint # TODO: Use errors package.
# - errcheck # TODO: Not all received errors are checked.
# - errorlint # TODO: Use errors package.
- exportloopref
#- forcetypeassert # TODO: always assert types when when casting.
#- funlen # TODO: Reduce code complexity.
# - forcetypeassert # TODO: always assert types when when casting.
# - funlen # TODO: Reduce code complexity.
- gci
#- gochecknoglobals # TODO: Reduce number of globals.
#- gochecknoinits # TODO: Maybe not use init().
#- gocognit # TODO: Reduce code complexity.
# - gochecknoglobals # TODO: Reduce number of globals.
# - gochecknoinits # TODO: Maybe not use init().
# - gocognit # TODO: Reduce code complexity.
- gocritic
#- gocyclo # TODO: Reduce code complexity.
# - gocyclo # TODO: Reduce code complexity.
- godot
#- goerr113 # TODO: Please do not use dynamic errors.
# - goerr113 # TODO: Please do not use dynamic errors.
- gofmt
- gofumpt
- goheader
Expand All @@ -40,37 +41,79 @@ linters:
- makezero
- misspell
- nakedret
#- nestif # TODO: Reduce code complexity.
# - nestif # TODO: Reduce code complexity.
- nilerr
- nlreturn
- noctx
- nolintlint
#- paralleltest # TODO: missing at some locations
# - paralleltest # TODO: missing at some locations
- prealloc
- predeclared
- revive
- rowserrcheck
- sqlclosecheck
- staticcheck
- stylecheck
#- testpackage # TODO: Put tests in their dedicated test packages.
#- thelper # TODO: Requires test refactoring.
# - testpackage # TODO: Put tests in their dedicated test packages.
# - thelper # TODO: Requires test refactoring.
- tparallel
- typecheck
- unconvert
#- unparam # TODO: This breaks something, look at it!
# - unparam # TODO: This breaks something, look at it!
- unused
- wastedassign
- whitespace
# - wrapcheck # TODO: Errors passed upwards should be wrapped.

linters-settings:
depguard:
rules:
main:
files:
- "$all"
- "!$test"
- "!**/functional/**/*.go"
allow:
- "$gostd"
- "github.com/ansible/receptor/internal/version"
- "github.com/ansible/receptor/pkg"
- "github.com/creack/pty"
- "github.com/fsnotify/fsnotify"
- "github.com/ghjm/cmdline"
- "github.com/golang-jwt/jwt/v4"
- "github.com/google/shlex"
- "github.com/gorilla/websocket"
- "github.com/jupp0r/go-priority-queue"
- "github.com/minio/highwayhash"
- "github.com/pbnjay/memory"
- "github.com/quic-go/quic-go"
- "github.com/rogpeppe/go-internal/lockedfile"
- "github.com/songgao/water"
- "github.com/vishvananda/netlink"
- "k8s.io/api/core"
- "k8s.io/apimachinery/pkg"
- "k8s.io/client-go"
tests:
files:
- "$test"
- "**/functional/**/*.go"
allow:
- "$gostd"
- "github.com/ansible/receptor/pkg"
- "github.com/ansible/receptor/tests/utils"
- "github.com/fortytw2/leaktest"
- "github.com/gorilla/websocket"
- "github.com/golang/mock/gomock"
- "github.com/prep/socketpair"

issues:
# Dont commit the following line.
# Dont commit the following line.
# It will make CI pass without telling you about errors.
# fix: true
exclude:
- "lostcancel" # TODO: Context is not canceled on multiple occasions. Needs more detailed work to be fixed.
- "SA2002|thelper|testinggoroutine" # TODO: Test interface used outside of its routine, tests need to be rewritten.
- "G306" # TODO: Restrict perms of touched files.
- "G402|G404" # TODO: Make TLS more secure.
- "G204" # gosec is throwing a fit, ignore.
- "lostcancel" # TODO: Context is not canceled on multiple occasions. Needs more detailed work to be fixed.
- "SA2002|thelper|testinggoroutine" # TODO: Test interface used outside of its routine, tests need to be rewritten.
- "G306" # TODO: Restrict perms of touched files.
- "G402|G404" # TODO: Make TLS more secure.
- "G204" # gosec is throwing a fit, ignore.
...
Loading