Skip to content

Commit

Permalink
Fix make lint and make gosec error (#1128)
Browse files Browse the repository at this point in the history
fix #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 authored Oct 17, 2021
1 parent 95479ef commit 694c9ba
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 694c9ba

Please sign in to comment.