Skip to content

Commit

Permalink
Add golint verification
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheng Pan committed Nov 6, 2018
1 parent 146ddf9 commit ea4ae91
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions hack/verify-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ PKG_ROOT=$(git rev-parse --show-toplevel)

${PKG_ROOT}/hack/verify-gofmt
${PKG_ROOT}/hack/verify-govet
${PKG_ROOT}/hack/verify-golint
27 changes: 27 additions & 0 deletions hack/verify-golint
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

# Copyright 2018 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -euo pipefail

if ! which golangci-lint > /dev/null; then
echo 'Cannot find golangci-lint. Installing golangci-lint...'
go get -v github.com/golangci/golangci-lint/cmd/golangci-lint
fi

golangci-lint run --deadline=10m

echo "Congratulations! All Go source files have been linted.'

0 comments on commit ea4ae91

Please sign in to comment.