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
@rm3l rm3l self-requested a review May 13, 2024 15:47
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
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
Member

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.

Copy link
Member

Choose a reason for hiding this comment

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

@coreydaley WDYT?

@gazarenkov gazarenkov added the do-not-merge/hold PR should not merge yet because someone has issued a /hold command. Required by Prow. label May 28, 2024
@gazarenkov
Copy link
Member

Postpone for 1.3

Copy link
Member

@rm3l rm3l left a comment

Choose a reason for hiding this comment

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

@coreydaley Could you please rebase your branch and fix the conflicts?

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

Choose a reason for hiding this comment

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

@coreydaley WDYT?

@rm3l rm3l self-assigned this Jun 11, 2024
Copy link

openshift-ci bot commented Jun 11, 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 ask for approval from coreydaley. 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

@coreydaley
Copy link
Member Author

@rm3l This pull request has just been rebased.

Copy link

sonarcloud bot commented Jun 11, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

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

See analysis details on SonarCloud

@rm3l rm3l removed the do-not-merge/hold PR should not merge yet because someone has issued a /hold command. Required by Prow. label Jun 24, 2024
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.

None yet

4 participants