From 2e8acadde141fd845b58484ec74a688920206b39 Mon Sep 17 00:00:00 2001 From: Tom Fleet Date: Sun, 9 Oct 2022 14:21:38 +0100 Subject: [PATCH] Fix Makefile install instructions and CONTRIBUTING.md --- CONTRIBUTING.md | 4 ++++ Makefile | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6f356e6a..02d7ada1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -37,6 +37,8 @@ If you have questions regarding Cobra, feel free to ask it in the community ### Quick steps to contribute +You'll need [golangci-lint] and [richgo] installed in order to run linting and unit tests + 1. Fork the project. 1. Download your fork to your PC (`git clone https://github.com/your_username/cobra && cd cobra`) 1. Create your feature branch (`git checkout -b my-new-feature`) @@ -48,3 +50,5 @@ If you have questions regarding Cobra, feel free to ask it in the community [cobra-slack]: https://gophers.slack.com/archives/CD3LP1199 +[golangci-lint]: https://golangci-lint.run +[richgo]: https://github.com/kyoh86/richgo diff --git a/Makefile b/Makefile index c433a01b..c5d704f4 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,13 @@ BIN="./bin" SRC=$(shell find . -name "*.go") +GOPATH=$(shell go env GOPATH) ifeq (, $(shell which golangci-lint)) -$(warning "could not find golangci-lint in $(PATH), run: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh") +$(warning "could not find golangci-lint in PATH, run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin v1.50.0") endif ifeq (, $(shell which richgo)) -$(warning "could not find richgo in $(PATH), run: go install github.com/kyoh86/richgo@latest") +$(warning "could not find richgo in PATH, run: go install github.com/kyoh86/richgo@latest") endif .PHONY: fmt lint test install_deps clean