mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-28 01:41:48 -06:00
740b8bb9cb
* provider/aws: Add errcheck to Makefile, error on unchecked errors * more exceptions * updates for errcheck to pass * reformat and spilt out the ignore statements * narrow down ignores * fix typo, only ignore Close and Write, instead of close or write
26 lines
703 B
Bash
Executable File
26 lines
703 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Check gofmt
|
|
echo "==> Checking AWS provider for unchecked errors..."
|
|
echo "==> NOTE: at this time we only look for uncheck errors in the AWS package"
|
|
|
|
if ! which errcheck > /dev/null; then
|
|
echo "==> Installing errcheck..."
|
|
go get -u github.com/kisielk/errcheck
|
|
fi
|
|
|
|
err_files=$(errcheck -ignoretests -ignore \
|
|
'github.com/hashicorp/terraform/helper/schema:Set' \
|
|
-ignore 'bytes:.*' \
|
|
-ignore 'io:Close|Write' \
|
|
./builtin/providers/aws/...)
|
|
|
|
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
|