Skip to content

Commit

Permalink
Replace gometalinter with GolangCI-Lint
Browse files Browse the repository at this point in the history
gometalinter is broken @ HEAD, and I looked into why that was. During
that process, I remembered that we took the linting scripts from
skaffold, and found that in skaffold gometalinter was replaced with
GolangCI-Lint:

GoogleContainerTools/skaffold#619

The change made linting in skaffold faster, so I figured instead of
fixing gometalinter it made more sense to remove it and replace it with
GolangCI-Lint for kaniko as well.
  • Loading branch information
Priya Wadhwa committed Sep 11, 2018
1 parent 06defa6 commit 5733b6e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
29 changes: 15 additions & 14 deletions hack/gometalinter.sh → hack/linter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,23 @@
# See the License for the specific language governing permissions and
# limitations under the License.


#!/bin/bash
set -e -o pipefail

SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

install_gometalinter() {
echo "Installing gometalinter.v2"
go get -u gopkg.in/alecthomas/gometalinter.v2
gometalinter.v2 --install
}
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

if ! [ -x "$(command -v gometalinter.v2)" ]; then
install_gometalinter
if ! [ -x "$(command -v golangci-lint)" ]; then
echo "Installing GolangCI-Lint"
${DIR}/install_golint.sh -b $GOPATH/bin v1.9.3
fi

gometalinter.v2 \
${GOMETALINTER_OPTS:--deadine 5m} \
--config $SCRIPTDIR/gometalinter.json ./...
golangci-lint run \
--no-config \
-E goconst \
-E goimports \
-E golint \
-E interfacer \
-E maligned \
-E misspell \
-E unconvert \
-E unparam \
-D errcheck
2 changes: 1 addition & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ echo "Running validation scripts..."
scripts=(
"hack/boilerplate.sh"
"hack/gofmt.sh"
"hack/gometalinter.sh"
"hack/linter.sh"
"hack/dep.sh"
)
fail=0
Expand Down

0 comments on commit 5733b6e

Please sign in to comment.