From 7ebd88d2d9d499f606e56a567be8fe6a18f25258 Mon Sep 17 00:00:00 2001 From: Cory Snider Date: Thu, 29 Feb 2024 16:14:50 -0500 Subject: [PATCH] hack: block imports of vendored testify packages While github.com/stretchr/testify is not used directly by any of the repository code, it is a transitive dependency via Swarmkit and therefore still easy to use without having to revendor. Add lint rules to ban importing testify packages to make sure nobody does. Signed-off-by: Cory Snider --- .golangci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.golangci.yml b/.golangci.yml index 160d88a679..f437b49321 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -45,6 +45,12 @@ linters-settings: deny: - pkg: io/ioutil desc: The io/ioutil package has been deprecated, see https://go.dev/doc/go1.16#ioutil + - pkg: "github.com/stretchr/testify/assert" + desc: Use "gotest.tools/v3/assert" instead + - pkg: "github.com/stretchr/testify/require" + desc: Use "gotest.tools/v3/assert" instead + - pkg: "github.com/stretchr/testify/suite" + desc: Do not use revive: rules: # FIXME make sure all packages have a description. Currently, there's many packages without.