mirror of
https://github.com/hashicorp/terraform-provider-kubernetes.git
synced 2026-02-18 18:18:54 -05:00
* initial type-assertion commit * add errcheck package * add copyright * check all directories in manifest folder * Apply suggestions from code review * use go install * Add bash header --------- Co-authored-by: Alex Somesan <alex.somesan@gmail.com> Co-authored-by: Aleksandr Rybolovlev <sacha.rybolovlev@hashicorp.com>
28 lines
882 B
Bash
Executable file
28 lines
882 B
Bash
Executable file
#!/usr/bin/env bash
|
|
# Copyright (c) HashiCorp, Inc.
|
|
# SPDX-License-Identifier: MPL-2.0
|
|
|
|
echo "==> Checking for unchecked errors..."
|
|
|
|
if ! which errcheck > /dev/null; then
|
|
echo "==> Installing errcheck..."
|
|
go install github.com/kisielk/errcheck@latest
|
|
fi
|
|
|
|
err_files=$($(go env GOPATH)/bin/errcheck -exclude scripts/errcheck_excludes.txt \
|
|
-verbose \
|
|
-ignoretests \
|
|
-ignore 'github.com/hashicorp/terraform/helper/schema:Set' \
|
|
-ignore 'bytes:.*' \
|
|
-ignore 'io:Close|Write' \
|
|
-asserts ./manifest/.../ \
|
|
)
|
|
|
|
if [[ -n ${err_files} ]]; then
|
|
echo 'Unchecked errors found in the following places:'
|
|
echo "${err_files}"
|
|
echo "Please handle returned errors. You can check directly with \`make errcheck\`"
|
|
exit 1
|
|
fi
|
|
|
|
exit 0
|