Skip to content

Improve code quality using gofmt and go lint #148

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

Merged
merged 1 commit into from
Aug 29, 2019

Conversation

codenio
Copy link
Contributor

@codenio codenio commented Aug 25, 2019

This PR,

  • Refactors code using gofmt and go lint to improve code quality.
  • Adds scripts to gofmt code and to update required changes
  • Adds scripts to go lint and go vet code
  • Adds lint stage before build to retain code quality
  • Adds Godocs Badge to README.md

preview:
goes from Go Report Card to Go Report Card

@codenio
Copy link
Contributor Author

codenio commented Aug 25, 2019

@databus23, @mumoshu. Can this be reviewed and merged?

@codenio codenio force-pushed the feature/refactor-code branch 2 times, most recently from 0dbaf7e to e213259 Compare August 25, 2019 05:18
@codenio
Copy link
Contributor Author

codenio commented Aug 25, 2019

self-reviewed and pushed the changes.

Copy link
Collaborator

@mumoshu mumoshu left a comment

Choose a reason for hiding this comment

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

@aananthraj Hey! Thanks a lot for your contribution.

This looks great overall!

Only change I'd like to see is to retain the name of DiffManifests so that the method name conforms to the convention of being "verb (+ noun)". I believe Diff was used like a a verb after the *unix diff command.

@codenio
Copy link
Contributor Author

codenio commented Aug 28, 2019

so that the method name conforms to the convention of being "verb (+ noun)".

I do agree with your point. I had to change it, as it was reported by gofmt or go lint that
package name and func name are same.
Do let me know, if we need to revert back to old form 👍

@mumoshu
Copy link
Collaborator

mumoshu commented Aug 28, 2019

@aananthraj Ah good point. Then just diff.Manifests and diff.Releases without Diff makes sense to me. Would you mind changing code in that way?

It is a breaking change for anyone using helm-diff as a go library. But it isn't an intended use-case at the moment and I'll keep it until I hear from anyone requesting to bring back the go-level API compatibility. That said, please forgive me if I reverted part of this or altered the lint script to ignore errors on the two method names :)

@codenio
Copy link
Contributor Author

codenio commented Aug 28, 2019

Would you mind changing code in that way?

Sure will make those changes and update here

It is a breaking change for anyone using helm-diff as a go library.

https://godoc.org/github.com/databus23/helm-diff
Godocs says helm-diff is presently not being imported into other golang packages.
So I guess change this will have a very minimalistic impact.

please forgive me if I reverted part of this or altered the lint script to ignore errors on the two method names :)

No issues on this 👍

This Commit,
- Refactors code using `gofmt` and `go lint` to improve code quality. 
- Adds scripts to `gofmt` code and to update required changes
- Adds scripts to `go lint` and `go vet` code
- Adds `lint` stage before `build` to retain code quality
- Adds Godocs Badge to README.md
@codenio codenio force-pushed the feature/refactor-code branch from e213259 to 74ce777 Compare August 28, 2019 10:34
@codenio
Copy link
Contributor Author

codenio commented Aug 28, 2019

@mumoshu made those requested changes

Copy link
Collaborator

@mumoshu mumoshu left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks a lot for your efforts! ☺️

@mumoshu mumoshu merged commit 99b8474 into databus23:master Aug 29, 2019
@codenio codenio deleted the feature/refactor-code branch August 30, 2019 00:51
@codenio
Copy link
Contributor Author

codenio commented Aug 30, 2019

Thanks @mumoshu for the prompt responce and support 👍

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.

2 participants