Skip to content

Commit

Permalink
Merge pull request #18 from volcano-sh/opt/ensure_golint_exists
Browse files Browse the repository at this point in the history
Ensure golint binary exists before linting
  • Loading branch information
TommyLike authored Mar 18, 2019
2 parents efabe0b + 689805b commit 8cd5f3c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
11 changes: 0 additions & 11 deletions hack/.golint_failures
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,17 @@ volcano.sh/volcano/pkg/apis/batch/v1alpha1
volcano.sh/volcano/pkg/apis/bus/v1alpha1
volcano.sh/volcano/pkg/apis/helpers
volcano.sh/volcano/pkg/cli/job
volcano.sh/volcano/pkg/client/clientset/versioned
volcano.sh/volcano/pkg/client/clientset/versioned/fake
volcano.sh/volcano/pkg/client/clientset/versioned/scheme
volcano.sh/volcano/pkg/client/clientset/versioned/typed/batch/v1alpha1
volcano.sh/volcano/pkg/client/clientset/versioned/typed/batch/v1alpha1/fake
volcano.sh/volcano/pkg/client/clientset/versioned/typed/bus/v1alpha1
volcano.sh/volcano/pkg/client/clientset/versioned/typed/bus/v1alpha1/fake
volcano.sh/volcano/pkg/controllers/job
volcano.sh/volcano/pkg/controllers/job/apis
volcano.sh/volcano/pkg/controllers/job/cache
volcano.sh/volcano/pkg/controllers/job/state
volcano.sh/volcano/pkg/scheduler/actions
volcano.sh/volcano/pkg/scheduler/actions/allocate
volcano.sh/volcano/pkg/scheduler/actions/backfill
volcano.sh/volcano/pkg/scheduler/actions/preempt
volcano.sh/volcano/pkg/scheduler/actions/reclaim
volcano.sh/volcano/pkg/scheduler/algorithm/fairshare
volcano.sh/volcano/pkg/scheduler/plugins
volcano.sh/volcano/pkg/scheduler/plugins/conformance
volcano.sh/volcano/pkg/scheduler/plugins/drf
volcano.sh/volcano/pkg/scheduler/plugins/gang
volcano.sh/volcano/pkg/scheduler/plugins/nodeorder
volcano.sh/volcano/pkg/scheduler/plugins/predicates
volcano.sh/volcano/pkg/scheduler/plugins/priority
volcano.sh/volcano/pkg/scheduler/plugins/proportion
Expand Down
8 changes: 7 additions & 1 deletion hack/verify-golint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ source "${KUBE_ROOT}/hack/lib/init.sh"

kube::golang::verify_go_version

if ! which golint > /dev/null; then
echo 'Can not find golint, install with:'
echo 'go get -u github.com/golang/lint/golint'
exit 1
fi

cd "${KUBE_ROOT}"

array_contains () {
Expand Down Expand Up @@ -54,7 +60,7 @@ for p in "${all_packages[@]}"; do
# and not just the ones for the current platform.
# Packages with a corresponding foo_test package will make golint fail
# with a useless error. Just ignore that, see golang/lint#68.
failedLint=$(golint "$p" 2>/dev/null)
failedLint=$(golint "$p"/*.go 2>/dev/null)
array_contains "$p" "${failing_packages[@]}" && in_failing=$? || in_failing=$?
if [[ -n "${failedLint}" ]] && [[ "${in_failing}" -ne "0" ]]; then
errors+=( "${failedLint}" )
Expand Down

0 comments on commit 8cd5f3c

Please sign in to comment.