-
Notifications
You must be signed in to change notification settings - Fork 185
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
tree-wide: Fix imports grouping and add lint target #2624
Conversation
Add goimports linter to make sure all imports are grouped in the same way in all the repository. Signed-off-by: Mauricio Vásquez <mauriciov@microsoft.com>
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 if the CI is green
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.
Hi.
The CI fails due to flakyness, otherwise it looks good to me and is a good addition.
Best regards.
# A comma-separated list of prefixes, which, if set, checks import paths | ||
# with the given prefixes are grouped after 3rd-party packages. | ||
# Default: "" | ||
local-prefixes: github.com/inspektor-gadget/inspektor-gadget |
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.
I am wondering if there is no such variable like ${{ github.repository }}
, this would make it portable but I am doubtful it exists.
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.
But even forks of the IG repo still use "github.com/inspektor-gadget/inspektor-gadget" in the Golang code. Forks might be used via a "replace" command in go.mod but the import paths remain the same as upstream.
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.
Sort of, if you modified something to a given package, you may want to use github.com/your_fork/inspektor-gadget
.
But I agree this would not be often the case, hence my approval.
Add goimports linter to make sure all imports are grouped in the same way in all the repository.