github.com/graywolf-at-work-2/terraform-vendor@v1.4.5/scripts/staticcheck.sh (about) 1 #!/usr/bin/env bash 2 3 echo "==> Checking that code complies with static analysis requirements..." 4 # Skip legacy code which is frozen, and can be removed once we can refactor the 5 # remote backends to no longer require it. 6 skip="internal/legacy|backend/remote-state/" 7 8 # Skip generated code for protobufs. 9 skip=$skip"|internal/planproto|internal/tfplugin5|internal/tfplugin6" 10 11 packages=$(go list ./... | egrep -v ${skip}) 12 13 # We are skipping style-related checks, since terraform intentionally breaks 14 # some of these. The goal here is to find issues that reduce code clarity, or 15 # may result in bugs. We also disable fucntion deprecation checks (SA1019) 16 # because our policy is to update deprecated calls locally while making other 17 # nearby changes, rather than to make cross-cutting changes to update them all. 18 go run honnef.co/go/tools/cmd/staticcheck -checks 'all,-SA1019,-ST*' ${packages}