Merge pull request #84772 from hvaara/golint-failures-support-comments

Support comments in hack/.golint_failures
This commit is contained in:
Kubernetes Prow Robot 2019-11-07 04:36:17 -08:00 committed by GitHub
commit 0a46e374dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -1,3 +1,4 @@
# Apart from this line, only trailing comments are supported
cmd/cloud-controller-manager/app/apis/config/v1alpha1
cmd/kube-apiserver/app
cmd/kubeadm/app/apis/kubeadm/v1beta1
@ -226,7 +227,7 @@ pkg/util/ebtables
pkg/util/goroutinemap/exponentialbackoff
pkg/util/iptables
pkg/util/iptables/testing
pkg/util/labels
pkg/util/labels # See previous effort in PR #80685
pkg/util/mount
pkg/util/oom
pkg/util/procfs

View File

@ -46,8 +46,10 @@ export IFS=$'\n'
# with a leading underscore. We'll need to support both scenarios for all_packages.
all_packages=()
while IFS='' read -r line; do all_packages+=("$line"); done < <(go list -e ./... | grep -vE "/(third_party|vendor|staging/src/k8s.io/client-go/pkg|generated|clientset_generated)" | sed -e 's|^k8s.io/kubernetes/||' -e "s|^_\(${KUBE_ROOT}/\)\{0,1\}||")
# The regex below removes any "#" character and anything behind it and including any
# whitespace before it. Then it removes empty lines.
failing_packages=()
while IFS='' read -r line; do failing_packages+=("$line"); done < <(cat "$failure_file")
while IFS='' read -r line; do failing_packages+=("$line"); done < <(sed -e 's/[[:blank:]]*#.*//' -e '/^$/d' "$failure_file")
unset IFS
errors=()
not_failing=()