mirror of
https://github.com/hashicorp/terraform.git
synced 2026-02-03 20:50:59 -05:00
Since we already specify a list of staticcheck rules to ignore in the scripts/staticcheck.sh wrapper script, this hoists those preferences up to the top of the package tree, so they also affect the staticcheck integration in editors like VSCode. This avoids unnecessary yellow-squiggles for capitalized error messages, and makes integrated linting much more useful.
18 lines
666 B
Bash
Executable file
18 lines
666 B
Bash
Executable file
#!/usr/bin/env bash
|
|
# Copyright (c) HashiCorp, Inc.
|
|
# SPDX-License-Identifier: BUSL-1.1
|
|
|
|
|
|
echo "==> Checking that code complies with static analysis requirements..."
|
|
# Skip legacy code which is frozen, and can be removed once we can refactor the
|
|
# remote backends to no longer require it.
|
|
skip="internal/legacy|backend/remote-state/"
|
|
|
|
# Skip generated code for protobufs.
|
|
skip=$skip"|internal/planproto|internal/tfplugin5|internal/tfplugin6"
|
|
|
|
packages=$(go list ./... | egrep -v ${skip})
|
|
|
|
# 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}
|