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

Setup go-imports-organizer and organize Go imports #357

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

coreydaley
Copy link
Member

This is what it would look like to implement and run the go-imports-organizer on this project. Please note that I have setup the dependencies to be vendored to support not having each user install the go-imports-organizer as a standalone tool

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress PR should not merge because it is a draft or work in progress. Required by Prow. label May 10, 2024
Copy link

openshift-ci bot commented May 10, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign rm3l for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Copy link

sonarcloud bot commented May 14, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

main.go Show resolved Hide resolved
@coreydaley coreydaley changed the title [WIP] Setup go-imports-organizer and organize Go imports Setup go-imports-organizer and organize Go imports May 15, 2024
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress PR should not merge because it is a draft or work in progress. Required by Prow. label May 15, 2024
fmt: goimports ## Format the code using goimports
find . -not -path '*/\.*' -name '*.go' -exec $(GOIMPORTS) -w {} \;
fmt: ## Run go fmt verifications
hack/verify-gofmt.sh
Copy link
Member

@rm3l rm3l May 16, 2024

Choose a reason for hiding this comment

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

I used to run make fmt to have the code formatted, but with this, it would just verify and exit, which is kinda surprising to me. If we are just calling ./hack/verify-gofmt.sh, I would suggest renaming this Make target into verify-fmt to make the intent clearer..

I noticed that goio also formats the code as well, besides organizing the imports, right? So maybe this target could just be this instead:

fmt: imports ## Format the code using goio

Then a separate verify-fmt target that would run hack/verify-gofmt.sh.

WDYT?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need fmt verification at all?

Copy link
Member

Choose a reason for hiding this comment

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

I agree fmt verification might not be necessary.

@openshift-merge-robot
Copy link

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants