exclude generated files from the static check

This commit is contained in:
SataQiu 2021-11-15 18:07:45 +08:00
parent 5eb584d1cb
commit 7dedd412f0

View File

@ -99,6 +99,12 @@ while read -r error; do
continue
fi
# Ignore the errors caused by the generated files
ignore_gen_files=".*/zz_generated\.[a-z]+\.go:.*"
if [[ $error =~ $ignore_gen_files ]]; then
continue
fi
file="${error%%:*}"
pkg="$(dirname "$file")"
kube::util::array_contains "$pkg" "${failing_packages[@]}" && in_failing=$? || in_failing=$?