Skip to content

Commit

Permalink
Merge pull request #127 from Charliekenney23/pin-golangci-lint
Browse files Browse the repository at this point in the history
pin golangci-lint
  • Loading branch information
phillc authored Feb 20, 2020
2 parents 238a8cd + 152c992 commit 6e1f5f4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ linters:
- stylecheck
- wsl
- interfacer
- gomnd
fast: false

16 changes: 11 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
-include .env
BIN_DIR := $(GOPATH)/bin
GOLANGCILINT := golangci-lint

GOLANGCILINT := golangci-lint
GOLANGCILINT_IMG := golangci/golangci-lint:v1.23-alpine
GOLANGCILINT_ARGS := run

PACKAGES := $(shell go list ./... | grep -v integration)

SKIP_LINT ?= 0

.PHONY: build vet test refresh-fixtures clean-fixtures lint run_fixtures sanitize fixtures godoc testint testunit

test: testunit testint

citest: lint test

testunit: build lint
go test -v $(PACKAGES) $(ARGS)

Expand All @@ -25,11 +32,10 @@ vet:
go vet ./...

lint:
ifndef $(shell command -v $(GOLANGCILINT) -v dot 2> /dev/null)
@echo Warning golangci-lint not installed. Skipping lint step
@echo Installation: https://github.com/golangci/golangci-lint#install
ifeq ($(SKIP_LINT), 1)
@echo Skipping lint stage
else
$(GOLANGCILINT) $(GOLANGCILINT_ARGS)
docker run --rm -v $(shell pwd):/app -w /app $(GOLANGCILINT_IMG) $(GOLANGCILINT) run
endif

clean-fixtures:
Expand Down

0 comments on commit 6e1f5f4

Please sign in to comment.