From f346392eea46b75e36e9ab7ae69f9a0f59c9d05a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20Abdelkader=20Mart=C3=ADnez=20P=C3=A9rez?= Date: Tue, 8 Oct 2019 09:26:18 +0200 Subject: [PATCH] Add linter to makefile and to circleci --- .circleci/config.yml | 1 + Makefile | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 44b3949..c00cf70 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,6 +8,7 @@ jobs: - image: circleci/golang:1.13 steps: - checkout + - run: curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.20.0 - run: make - persist_to_workspace: root: . diff --git a/Makefile b/Makefile index d02f302..895e7a5 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,11 @@ -.PHONY: build test coverage install acceptance deps +.PHONY: lint build test race coverage install acceptance deps GOCMD=go GOBUILD=$(GOCMD) build GOGET=$(GOCMD) get GOTEST=$(GOCMD) test GOTOOL=$(GOCMD) tool +GOLANGLINT=golangci-lint BUILD_DIR=./build OUTPUT_DIR=./output @@ -12,7 +13,10 @@ TMP_DIR=/tmp BINARY_NAME=kapow -all: test race build +all: lint test race build + +lint: + $(GOLANGLINT) run build: deps mkdir -p $(BUILD_DIR)