-
Notifications
You must be signed in to change notification settings - Fork 44
Integrate the Go modernize tool to enforce latest Go style convention #811
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
base: main
Are you sure you want to change the base?
Conversation
- Add 'style-check' target to Makefile using golang.org/x/tools/gopls/internal/analysis/modernize - Add pre-commit hook to automatically run style checks on commits Benefits: - Ensures consistent code style across the codebase - Automatically applies modern Go idioms and best practices - Catches style issues early in the development process - Maintains code quality and readability standards - Reduces review overhead by automating style enforcement Co-Authored-By: Claude [email protected] Signed-off-by: Francesco Pantano <[email protected]>
abays
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abays, fmount The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/test glance-operator-build-kuttl |
| go vet ./... ./api/... | ||
|
|
||
| .PHONY: style-check | ||
| style-check: ## Run go modernize to check latest style conventions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its only a nit but i woudl proably have gone with modernize
as the make target name
mainly be cause i think for go format when i think if style checks but that is jsut me.
+1
style-checktarget toMakefileusinggolang.org/x/tools/gopls/internal/analysis/modernizepre-commithook to automatically run style checks on commitsBenefits:
Co-Authored-By: Claude [email protected]