github.com/muratcelep/terraform@v1.1.0-beta2-not-internal-4/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.
    16  go run honnef.co/go/tools/cmd/staticcheck -checks 'all,-ST*' ${packages}