Commit d8aac17d authored by Ian Cardoso's avatar Ian Cardoso Committed by Ian Cardoso

add format command on Makefile and remove vendor

This commit adds the format command to make it easier to be compliant to golangci-lint issues Signed-off-by: 's avatarIan Cardoso <osodracnai@gmail.com>
parent 4e1ba3a0
...@@ -88,3 +88,18 @@ Signed-off-by: Jane Smith <jane.smith@example.com> ...@@ -88,3 +88,18 @@ Signed-off-by: Jane Smith <jane.smith@example.com>
In most cases, you can add this signoff to your commit automatically with the In most cases, you can add this signoff to your commit automatically with the
`-s` flag to `git commit`. Please use your real name and a reachable email address. `-s` flag to `git commit`. Please use your real name and a reachable email address.
## Golangci-lint ##
There is a CI check for formatting on our code, you'll need to install `goimports` to be able to attend this check, you can do it by running the command:
```
go install golang.org/x/tools/cmd/goimports@latest
```
then run:
```
make format
```
\ No newline at end of file
TARGETS := $(shell ls scripts | grep -v \\.sh) TARGETS := $(shell ls scripts | grep -v \\.sh)
GO_FILES ?= $$(find . -name '*.go' | grep -v generated)
.dapper: .dapper:
@echo Downloading dapper @echo Downloading dapper
...@@ -12,7 +14,6 @@ $(TARGETS): .dapper ...@@ -12,7 +14,6 @@ $(TARGETS): .dapper
.PHONY: deps .PHONY: deps
deps: deps:
go mod vendor
go mod tidy go mod tidy
release: release:
...@@ -32,3 +33,7 @@ binary-size-check: ...@@ -32,3 +33,7 @@ binary-size-check:
.PHONY: image-scan .PHONY: image-scan
image-scan: image-scan:
scripts/image_scan.sh $(IMAGE) scripts/image_scan.sh $(IMAGE)
format:
gofmt -s -l -w $(GO_FILES)
goimports -w $(GO_FILES)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment