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 option to separate named imports #159

Merged
merged 1 commit into from
Nov 21, 2024
Merged

Conversation

n-oden
Copy link
Contributor

@n-oden n-oden commented Jul 3, 2024

This addresses #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.

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
Copy link
Contributor Author

n-oden commented Nov 20, 2024

@incu6us I've updated this against current upstream/master and fixed the conflict

@@ -84,6 +84,8 @@ Usage of goimports-reviser:
Apply rules recursively if target is a directory. In case of ./... execution will be recursively applied by default. Optional parameter.
-rm-unused
Remove unused imports. Optional parameter.
-separate-named
Separate named imports from their group with a new line. Optional parameter.

Choose a reason for hiding this comment

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

I would have reused the "alias" term

Suggested change
Separate named imports from their group with a new line. Optional parameter.
Separate aliased imports from their group with a new line. Optional parameter.

@@ -56,6 +57,7 @@ var (
shouldSetAlias *bool
shouldFormat *bool
shouldApplyToGeneratedFiles *bool
shouldSeparateNamedImports *bool

Choose a reason for hiding this comment

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

Suggested change
shouldSeparateNamedImports *bool
shouldSeparateAliases *bool

And rename everything

@incu6us incu6us merged commit 3423e46 into incu6us:master Nov 21, 2024
9 checks passed
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.

3 participants