diff --git a/scripts/staticcheck.sh b/scripts/staticcheck.sh index 91f4742a11dd..d76518ad11cc 100755 --- a/scripts/staticcheck.sh +++ b/scripts/staticcheck.sh @@ -13,9 +13,6 @@ skip=$skip"|internal/planproto|internal/tfplugin5|internal/tfplugin6" packages=$(go list ./... | egrep -v ${skip}) -# We are skipping style-related checks, since terraform intentionally breaks -# some of these. The goal here is to find issues that reduce code clarity, or -# may result in bugs. We also disable fucntion deprecation checks (SA1019) -# because our policy is to update deprecated calls locally while making other -# nearby changes, rather than to make cross-cutting changes to update them all. -go run honnef.co/go/tools/cmd/staticcheck -checks 'all,-SA1019,-ST*' ${packages} +# Note that we globally disable some checks. The list is controlled by the +# top-level staticcheck.conf file in this repo. +go run honnef.co/go/tools/cmd/staticcheck ${packages} diff --git a/staticcheck.conf b/staticcheck.conf new file mode 100644 index 000000000000..20851da80728 --- /dev/null +++ b/staticcheck.conf @@ -0,0 +1,7 @@ +# Our goal in using staticcheck is to find issues that reduce code clarity, or +# may result in bugs. We are skipping style-related checks, since terraform +# intentionally breaks some of these. We also disable function deprecation +# checks (SA1019) because our policy is to update deprecated calls locally while +# making other nearby changes, rather than to make cross-cutting changes to +# update them all. +checks = ["all", "-SA1019", "-ST*"]