Skip to content

Commit

Permalink
Introduce gosec as part of the linting suite
Browse files Browse the repository at this point in the history
Adding it here means it will be run as part of `scripts/check-everything.sh`, github actions on a PR, and `run-tests-main` on concourse.

Issue: #1599
  • Loading branch information
Kieron Browne authored and kieron-dev committed Jul 6, 2023
1 parent f109eb9 commit d0f67a2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,12 @@ fmt: install-gofumpt install-shfmt
vet: ## Run go vet against code.
go vet ./...

lint: fmt vet
lint: fmt vet gosec
golangci-lint run -v

gosec: install-gosec
$(GOSEC) --exclude=G101,G304,G401,G404,G505 --exclude-dir=tests ./...

test: lint
@for comp in $(COMPONENTS); do make -C $$comp test; done
make test-tools
Expand Down Expand Up @@ -72,5 +75,9 @@ VENDIR = $(shell go env GOPATH)/bin/vendir
install-vendir:
go install github.com/vmware-tanzu/carvel-vendir/cmd/vendir@latest

GOSEC = $(shell go env GOPATH)/bin/gosec
install-gosec:
go install github.com/securego/gosec/v2/cmd/gosec@latest

vendir-update-dependencies: install-vendir
$(VENDIR) sync --chdir tests

0 comments on commit d0f67a2

Please sign in to comment.