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

tree-wide: Fix imports grouping and add lint target #2624

Merged
merged 1 commit into from
Mar 19, 2024

Conversation

mauriciovasquezbernal
Copy link
Member

Add goimports linter to make sure all imports are grouped in the same way in all the repository.

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>
Copy link
Member

@alban alban left a 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

Copy link
Member

@eiffel-fl eiffel-fl left a 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
Copy link
Member

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.

Copy link
Member

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.

Copy link
Member

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.

@mauriciovasquezbernal mauriciovasquezbernal merged commit b279b3a into main Mar 19, 2024
59 checks passed
@mauriciovasquezbernal mauriciovasquezbernal deleted the mauricio/group-imports branch March 19, 2024 15:44
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

3 participants