From 4b38912ae6be53910d5f5163145eb4bf6b8889db Mon Sep 17 00:00:00 2001 From: "Dr. Stefan Schimanski" Date: Mon, 22 Aug 2016 13:17:47 +0200 Subject: [PATCH 1/2] Check sorting of linted file in hack/verify-golint.sh --- hack/verify-golint.sh | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/hack/verify-golint.sh b/hack/verify-golint.sh index e1d4568e02f..ae881348371 100755 --- a/hack/verify-golint.sh +++ b/hack/verify-golint.sh @@ -37,11 +37,23 @@ array_contains () { return $in } +# Check that the file is in alphabetical order +linted_file="${KUBE_ROOT}/hack/.linted_packages" +if ! diff -u "${linted_file}" <(LANG=C sort "${linted_file}"); then + { + echo + echo "hack/.linted_packages is not in alphabetical order. Please sort it:" + echo + echo " sort -o hack/.linted_packages hack/.linted_packages" + echo + } >&2 + false +fi + export IFS=$'\n' all_packages=( $(go list -e ./... | egrep -v "/(third_party|vendor|staging|generated|clientset_generated)" | sed 's/k8s.io\/kubernetes\///g') ) -linted_file="${KUBE_ROOT}/hack/.linted_packages" linted_packages=( $(cat $linted_file) ) @@ -78,16 +90,20 @@ else fi # check to make sure all packages that pass lint are in the linted file. +echo if [ ${#linted[@]} -eq 0 ]; then echo 'Success! All packages that should pass lint are listed in the linted file.' else { - echo "The following packages passed golint but are not listed in $linted_file:" - for p in "${linted[@]}"; do - echo "echo $p >> hack/.linted_packages" - done + echo "Some packages passed golint but are not listed in hack/.linted_packages." + echo "Please add them in alphabetical order:" echo - echo 'Please add the following packages to the linted file. You can test via this script and commit the result.' + for p in "${linted[@]}"; do + echo " echo $p >> hack/.linted_packages" + done + echo " LANG=C sort -o hack/.linted_packages hack/.linted_packages" + echo + echo 'You can test via this script and commit the result.' echo } >&2 false From ac85f73f0d4f8cb8e745a21e146dc6a0c82a2f73 Mon Sep 17 00:00:00 2001 From: "Dr. Stefan Schimanski" Date: Tue, 23 Aug 2016 13:09:07 +0200 Subject: [PATCH 2/2] Sort linted file --- hack/.linted_packages | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/hack/.linted_packages b/hack/.linted_packages index 5aebef107d5..383f631ad23 100644 --- a/hack/.linted_packages +++ b/hack/.linted_packages @@ -9,10 +9,10 @@ cmd/kube-apiserver/app cmd/kube-apiserver/app/options cmd/kube-controller-manager cmd/kube-controller-manager/app/options -cmd/kubectl cmd/kube-dns -cmd/kubelet cmd/kube-proxy +cmd/kubectl +cmd/kubelet cmd/kubernetes-discovery cmd/libs/go2idl/client-gen/generators cmd/libs/go2idl/client-gen/test_apis/testgroup.k8s.io/install @@ -52,26 +52,26 @@ pkg/api pkg/api/annotations pkg/api/errors pkg/api/install -pkg/apimachinery pkg/api/meta pkg/api/resource +pkg/api/service +pkg/api/v1 +pkg/apimachinery pkg/apis/abac/v0 pkg/apis/apps/install -pkg/apis/authentication/install pkg/apis/authentication.k8s.io/install +pkg/apis/authentication/install pkg/apis/authorization/install pkg/apis/autoscaling/install pkg/apis/batch/install pkg/apis/certificates/install pkg/apis/componentconfig/install -pkg/apiserver/audit -pkg/api/service pkg/apis/extensions/install pkg/apis/extensions/v1beta1 +pkg/apis/imagepolicy/install pkg/apis/policy/install pkg/apis/rbac/install -pkg/apis/imagepolicy/install -pkg/api/v1 +pkg/apiserver/audit pkg/auth/authenticator pkg/auth/authorizer/union pkg/client/metrics @@ -98,36 +98,36 @@ pkg/credentialprovider/aws pkg/hyperkube pkg/kubelet/api pkg/kubelet/container -pkg/kubelet/eviction pkg/kubelet/envvars +pkg/kubelet/eviction pkg/kubelet/util/format pkg/kubelet/util/ioutils pkg/kubelet/volume pkg/kubelet/volume/cache +pkg/kubelet/volume/populator +pkg/kubelet/volume/reconciler pkg/kubelet/volumemanager pkg/kubelet/volumemanager/cache pkg/kubelet/volumemanager/populator pkg/kubelet/volumemanager/reconciler -pkg/kubelet/volume/populator -pkg/kubelet/volume/reconciler pkg/proxy/config pkg/proxy/healthcheck pkg/quota/install pkg/registry pkg/registry/authorization/util -pkg/registry/clusterrolebinding/etcd pkg/registry/clusterrole/etcd +pkg/registry/clusterrolebinding/etcd pkg/registry/configmap/etcd pkg/registry/endpoint pkg/registry/node/rest pkg/registry/pod/etcd pkg/registry/podsecuritypolicy/etcd pkg/registry/rangeallocation -pkg/registry/rolebinding/etcd pkg/registry/role/etcd -pkg/registry/serviceaccount +pkg/registry/rolebinding/etcd pkg/registry/service/ipallocator/controller pkg/registry/service/ipallocator/etcd +pkg/registry/serviceaccount pkg/registry/thirdpartyresource pkg/registry/thirdpartyresource/etcd pkg/runtime @@ -137,6 +137,7 @@ pkg/runtime/serializer/recognizer/testing pkg/runtime/serializer/versioning pkg/runtime/serializer/yaml pkg/security +pkg/security/podsecuritypolicy/apparmor pkg/security/podsecuritypolicy/capabilities pkg/serviceaccount pkg/storage @@ -156,10 +157,12 @@ pkg/util/io pkg/util/json pkg/util/limitwriter pkg/util/logs +pkg/util/maps pkg/util/validation/field pkg/util/workqueue pkg/volume pkg/volume/downwardapi +pkg/volume/quobyte pkg/volume/util/nestedpendingoperations pkg/volume/util/operationexecutor pkg/volume/util/types @@ -194,17 +197,14 @@ test/images/fakegitserver test/images/goproxy test/images/mount-tester test/images/n-way-http -test/images/porter test/images/port-forward-tester +test/images/porter test/images/resource-consumer/consume-cpu test/images/serve_hostname +test/integration/discoverysummarizer +test/integration/examples +test/integration/federation test/integration/openshift test/soak/cauldron test/soak/serve_hostnames third_party/forked/golang/expansion -pkg/util/maps -pkg/volume/quobyte -test/integration/discoverysummarizer -test/integration/examples -test/integration/federation -pkg/security/podsecuritypolicy/apparmor