From f6cc907166ddda2b084c3163ab20395189001cad Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Wed, 17 Aug 2022 13:49:33 -0700 Subject: [PATCH] build: Disable errors for deprecated functions in staticcheck Because we maintain multiple versions of Terraform across different release branches, we aim to avoid creating needless differences between the branches to maximize the chance of successful automatic backporting. Part of that policy is that we don't make cross-cutting changes to respond to deprecation of functions in upstream packages and instead we respond to them gradually over time when we'd be changing the nearby code anyway, or when new work requires using the replacement APIs. In recognition of that, this turns of the staticcheck rule that would otherwise force us to resolve all deprecations before moving forward with any other change. --- scripts/staticcheck.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/staticcheck.sh b/scripts/staticcheck.sh index 2dd08309a6..2ef394280f 100755 --- a/scripts/staticcheck.sh +++ b/scripts/staticcheck.sh @@ -12,5 +12,7 @@ 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. -go run honnef.co/go/tools/cmd/staticcheck -checks 'all,-ST*' ${packages} +# 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}