From 6cfef643826a896728220f2c884a1367b2c3f769 Mon Sep 17 00:00:00 2001 From: Dev Ojha Date: Wed, 18 Jul 2018 01:20:24 -0700 Subject: [PATCH] Merge PR #1732: tools: add make {get, update, check}_dev_tools This is so that validators can have a more minimal install, but we can still install linters for developers. (And any other future dev tools) --- .circleci/config.yml | 2 +- CONTRIBUTING.md | 2 +- Makefile | 10 ++++++++-- tools/Makefile | 11 ++++++++++- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a8d42872e4..7a77d8d217 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -62,7 +62,7 @@ jobs: name: Get metalinter command: | export PATH="$GOBIN:$PATH" - make get_tools + make get_dev_tools - run: name: Lint source command: | diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b18ef2ea95..de349501c3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing -Thank you for considering making contributions to Cosmos-SDK and related repositories! Start by taking a look at this [coding repo](https://github.com/tendermint/coding) for overall information on repository workflow and standards. +Thank you for considering making contributions to Cosmos-SDK and related repositories! Start by taking a look at this [coding repo](https://github.com/tendermint/coding) for overall information on repository workflow and standards. Note, we use `make get_dev_tools` and `make update_dev_tools` for installing the linting tools. Please follow standard github best practices: fork the repo, branch from the tip of develop, make some commits, and submit a pull request to develop. See the [open issues](https://github.com/cosmos/cosmos-sdk/issues) for things we need help with! diff --git a/Makefile b/Makefile index b6b136f517..74c25e461e 100644 --- a/Makefile +++ b/Makefile @@ -73,11 +73,17 @@ dist: check_tools: cd tools && $(MAKE) check_tools +check_dev_tools: + cd tools && $(MAKE) check_dev_tools + update_tools: cd tools && $(MAKE) update_tools -get_tools: - cd tools && $(MAKE) get_tools +update_dev_tools: + cd tools && $(MAKE) update_dev_tools + +get_dev_tools: + cd tools && $(MAKE) get_dev_tools get_vendor_deps: @rm -rf vendor/ diff --git a/tools/Makefile b/tools/Makefile index d58f52d1b1..66ad10f6e0 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -30,6 +30,9 @@ ifndef DEP_CHECK else @echo "Found dep in path." endif + +check_dev_tools: + $(MAKE) check_tools ifndef GOLINT_CHECK @echo "No golint in path. Install with 'make get_tools'." else @@ -78,6 +81,9 @@ else @echo "Installing dep" go get -v $(DEP) endif + +get_dev_tools: + $(MAKE) get_tools ifdef GOLINT_CHECK @echo "Golint is already installed. Run 'make update_tools' to update." else @@ -130,6 +136,9 @@ endif update_tools: @echo "Updating dep" go get -u -v $(DEP) + +update_dev_tools: + $(MAKE) update_tools @echo "Updating tendermint/golint" go get -u -v $(GOLINT) @echo "Updating gometalinter.v2" @@ -150,4 +159,4 @@ update_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 get_tools update_tools +.PHONY: check_tools get_tools update_tools check_dev_tools get_dev_tools update_dev_tools