Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch gometalinter to stable #1341

Merged
merged 4 commits into from
Jun 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,13 @@ jobs:
name: Get metalinter
command: |
export PATH="$GOBIN:$PATH"
go get -u github.com/tendermint/lint/golint
go get -u github.com/alecthomas/gometalinter
make get_tools
- run:
name: Lint source
command: |
export PATH="$GOBIN:$PATH"
gometalinter --disable-all --enable='golint' --vendor ./...
gometalinter.v2 --disable-all --enable='golint' --vendor ./...

test_unit:
<<: *defaults
parallelism: 4
Expand All @@ -84,7 +83,7 @@ jobs:
command: |
export PATH="$GOBIN:$PATH"
make test_unit

test_cli:
<<: *defaults
parallelism: 1
Expand All @@ -100,7 +99,7 @@ jobs:
command: |
export PATH="$GOBIN:$PATH"
make test_cli_retry

test_cover:
<<: *defaults
parallelism: 4
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ FEATURES
* Proposals need deposits to be votable; deposits are burned if proposal fails
* Delegators delegate votes to validator by default but can override (for their stake)
* [tools] make get_tools installs tendermint's linter, and gometalinter
* [tools] Switch gometalinter to the stable version

FIXES
* \#1259 - fix bug where certain tests that could have a nil pointer in defer
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ test_cover:
@bash tests/test_cover.sh

test_lint:
gometalinter --disable-all --enable='golint' --vendor ./...
gometalinter.v2 --disable-all --enable='golint' --vendor ./...

benchmark:
@go test -bench=. $(PACKAGES_NOCLITEST)
Expand Down
56 changes: 0 additions & 56 deletions tools/Gopkg.lock

This file was deleted.

34 changes: 0 additions & 34 deletions tools/Gopkg.toml

This file was deleted.

34 changes: 7 additions & 27 deletions tools/Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
all: install
all: get_tools


########################################
### DEP

DEP = github.com/golang/dep/cmd/dep
GOLINT = github.com/tendermint/lint/golint
GOMETALINTER = github.com/alecthomas/gometalinter
GOMETALINTER = gopkg.in/alecthomas/gometalinter.v2
DEP_CHECK := $(shell command -v dep 2> /dev/null)
GOLINT_CHECK := $(shell command -v golint 2> /dev/null)
GOMETALINTER_CHECK := $(shell command -v gometalinter 2> /dev/null)
GOMETALINTER_CHECK := $(shell command -v gometalinter.v2 2> /dev/null)

check_tools:
ifndef DEP_CHECK
Expand Down Expand Up @@ -42,9 +42,9 @@ else
go get -v $(GOLINT)
endif
ifdef GOMETALINTER_CHECK
@echo "Gometalinter is already installed. Run 'make update_tools' to update."
@echo "Gometalinter.v2 is already installed. Run 'make update_tools' to update."
else
@echo "Installing gometalinter"
@echo "Installing gometalinter.v2"
go get -v $(GOMETALINTER)
endif

Expand All @@ -53,30 +53,10 @@ update_tools:
go get -u -v $(DEP)
@echo "Updating tendermint/golint"
go get -u -v $(GOLINT)
@echo "Updating gometalinter"
@echo "Updating gometalinter.v2"
go get -u -v $(GOMETALINTER)


########################################
### Install tools


get_vendor_deps: check_tools
@rm -rf vendor/
@echo "--> Running dep ensure"
@dep ensure -v

install: get_vendor_deps
@echo "Installing tools"
@echo "Install go-vendorinstall"
go build -o bin/go-vendorinstall go-vendorinstall/*.go

@echo "Install gometalinter.v2"
GOBIN="$(CURDIR)/bin" ./bin/go-vendorinstall github.com/alecthomas/gometalinter

@echo "Done installing tools"

# To avoid unintended conflicts with file names, always add to .PHONY
# unless there is a reason not to.
# https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
.PHONY: check_tools install_tools update_tools get_vendor_deps install
.PHONY: check_tools get_tools update_tools
Empty file removed tools/bin/.gitkeep
Empty file.
129 changes: 0 additions & 129 deletions tools/go-vendorinstall/main.go

This file was deleted.

11 changes: 0 additions & 11 deletions tools/main.go

This file was deleted.