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

Add ability to add named imports in a separate group #116

Open
ustun-ed opened this issue Aug 8, 2023 · 1 comment
Open

Add ability to add named imports in a separate group #116

ustun-ed opened this issue Aug 8, 2023 · 1 comment

Comments

@ustun-ed
Copy link

ustun-ed commented Aug 8, 2023

We have the following internal code style:

  • Standard library imports
  • repository imports
  • Vendor imports
  • Named imports (all internal and external named should be in same group)

Example:

import (
	"context"
	"fmt"
	"time"

	"github.com/ourcompany/ourcompany/pkg/log"
	"github.com/ourcompany/ourcompany/pkg/percentile"

        "github.com/google/go-cmp/cmp"

	svc "github.com/ourcompany/ourcompany/pkg/aggregator_service"
)

Could you add support for the final named imports group?

@ustun-ed
Copy link
Author

ustun-ed commented Aug 8, 2023

Added a draft PR above.

n-oden added a commit to odenio/goimports-reviser that referenced this issue Jul 3, 2024
This addresses incu6us#116

Add a `-separate-named` boolean option.  When activated, named/aliased
imports are split off into a separate block below the relevant group,
e.g. named std below std, named project below project, etc.
n-oden added a commit to odenio/goimports-reviser that referenced this issue Jul 3, 2024
This addresses incu6us#116

Add a `-separate-named` boolean option.  When activated, named/aliased
imports are split off into a separate block below the relevant group,
e.g. named std below std, named project below project, etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant