Integrate the Go modernize tool to enforce latest Go style convention#811
Integrate the Go modernize tool to enforce latest Go style convention#811fmount wants to merge 1 commit intoopenstack-k8s-operators:mainfrom
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 noreply@anthropic.com Signed-off-by: Francesco Pantano <fpantano@redhat.com>
|
[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 DetailsNeeds 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.
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 noreply@anthropic.com