Skip to content

Commit

Permalink
golangci-lint: enable depguard to prevent re-introducing libcontainer
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thaJeztah committed Sep 1, 2023
1 parent 5d31e93 commit d28c3ea
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
linters:
enable:
- depguard # Checks for dependencies that should not be (re)introduced. See "linter-settings" for further details.
- exportloopref # Checks for pointers to enclosing loop variables
- gofmt
- goimports
Expand Down Expand Up @@ -52,6 +53,17 @@ issues:
text: "redefines-builtin-id"

linters-settings:
depguard:
rules:
main:
allow:
# TODO(thaJeztah): remove this once we updated CDI with https://github.com/cncf-tags/container-device-interface/pull/158 included
- github.com/opencontainers/runc/libcontainer/devices
- github.com/opencontainers/runc/libcontainer/user
deny:
- pkg: github.com/opencontainers/runc
desc: We don't want to introduce more dependencies on runc (libcontainer), unless there is no other option.

gosec:
# The following issues surfaced when `gosec` linter
# was enabled. They are temporarily excluded to unblock
Expand Down

0 comments on commit d28c3ea

Please sign in to comment.