Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Release-1.25] add format command on Makefile #7763

Merged
merged 1 commit into from
Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
`-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
```
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
TARGETS := $(shell ls scripts | grep -v \\.sh)
GO_FILES ?= $$(find . -name '*.go' | grep -v generated)


.dapper:
@echo Downloading dapper
Expand All @@ -12,7 +14,6 @@ $(TARGETS): .dapper

.PHONY: deps
deps:
go mod vendor
go mod tidy

release:
Expand All @@ -32,3 +33,7 @@ binary-size-check:
.PHONY: image-scan
image-scan:
scripts/image_scan.sh $(IMAGE)

format:
gofmt -s -l -w $(GO_FILES)
goimports -w $(GO_FILES)