Skip to content

Commit

Permalink
Fix make lint and make gosec error
Browse files Browse the repository at this point in the history
fix wtfutil#1127

Install golangci-lint / gosec, if it is not installed.
Use binary installation for golangci-lint because they recommend.
https://golangci-lint.run/usage/install/#local-installation
  • Loading branch information
yosmoc committed Oct 14, 2021
1 parent 9918480 commit d0254dc
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export GOPROXY = https://proxy.golang.org,direct
# Determines the path to this Makefile
THIS_FILE := $(lastword $(MAKEFILE_LIST))

GOBIN := $(GOPATH)/bin

APP=wtfutil

define HEADER
Expand Down Expand Up @@ -77,9 +79,12 @@ docker-install:
docker rm wtf_build

## gosec: runs the gosec static security scanner against the source code
gosec:
gosec: $(GOBIN)/gosec
gosec -tests ./...

$(GOBIN)/gosec:
cd && go install github.com/securego/gosec/v2/cmd/gosec@latest

## help: prints this help message
help:
@echo "Usage: \n"
Expand All @@ -101,10 +106,13 @@ install:
@echo "${APP} installed into ${INSTALLPATH}"

## lint: runs a number of code quality checks against the source code
lint:
lint: $(GOBIN)/golangci-lint
golangci-lint cache clean
golangci-lint run

$(GOBIN)/golangci-lint:
cd && go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest

# lint:
# @echo "\033[35mhttps://github.com/kisielk/errcheck\033[0m"
# errcheck ./app
Expand Down

0 comments on commit d0254dc

Please sign in to comment.