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

Enforce go imports grouping in CI #3706

Closed

Conversation

djdongjin
Copy link
Member

@djdongjin djdongjin commented Dec 1, 2024

By default goimports organize imports into 2 groups

import (
  std pkgs

  third-party / non-std pkgs
)

The local-prefixes option (https://golangci-lint.run/usage/linters/#goimports) in golang-ci (correspond to -local flag in goimports CLI https://cs.opensource.google/go/x/tools/+/refs/tags/v0.27.0:cmd/goimports/goimports.go;l=54) will enforce 3 groups instead:

import (
  std pkgs

  third-party pkgs

  local pkgs
)

I think this will provide a clear/consistent view of dependency import groups.

@apostasie
Copy link
Contributor

@djdongjin
Copy link
Member Author

Import grouping is already being enforced:

great. didn't aware we already have it.

@djdongjin djdongjin closed this Dec 2, 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.

2 participants