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

enable gofmt,golint and fix lint errors #1159

Merged
merged 2 commits into from
Sep 16, 2020
Merged

Conversation

silenceper
Copy link
Contributor

Signed-off-by: silenceper [email protected]

enable gofmt,golint for golangci, and fix lint errors.

gofmt file pkg/scalers/azure/azure_monitor_test.go

gofmt -w -s pkg/scalers/azure/azure_monitor_test.go 

Checklist

Fixes #

@zroubalik
Copy link
Member

How does this works with this:

https://github.com/kedacore/keda/blob/v2/Makefile#L199-L215

@silenceper
Copy link
Contributor Author

@zroubalik

  • make revive can change to make golangci
  • To be consistent, use gofmt instead of go fmt , because gofmt tool is used in golangci.

@zroubalik
Copy link
Member

@silenceper ok, would you mind changing the Makefile accordingly, please?

@silenceper
Copy link
Contributor Author

@zroubalik

PTAL

Copy link
Contributor

@ahmelsayed ahmelsayed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not I understand why the previous one was missing those files. from the help, it seems that go fmt runs gofmt -l -w. Maybe it's the -s for simplify code? Anyway, this looks good to me. Thanks @silenceper again.

@silenceper
Copy link
Contributor Author

silenceper commented Sep 16, 2020

Yes, I add -s to gofmt,otherwise golangci will fail to detect

Copy link
Member

@zroubalik zroubalik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zroubalik zroubalik merged commit f5489b8 into kedacore:v2 Sep 16, 2020
@silenceper silenceper deleted the add-linter branch September 16, 2020 10:23
silenceper added a commit to silenceper/keda that referenced this pull request Oct 1, 2020
* enable gofmt,golint and fix lint errors

Signed-off-by: silenceper <[email protected]>

* fix Makefile: change to golangci

Signed-off-by: silenceper <[email protected]>
SpiritZhou pushed a commit to SpiritZhou/keda that referenced this pull request Jul 18, 2023
Signed-off-by: Andy Ward <[email protected]>
Signed-off-by: Eldarrin <[email protected]>
Signed-off-by: Eldarrin <[email protected]>
Signed-off-by: Zbynek Roubalik <[email protected]>
Co-authored-by: Jorge Turrado Ferrero <[email protected]>
Co-authored-by: Zbynek Roubalik <[email protected]>
Co-authored-by: Tom Kerkhove <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants