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

support config the order of sections #74

Closed
daixiang0 opened this issue Jul 13, 2022 · 2 comments · Fixed by #90
Closed

support config the order of sections #74

daixiang0 opened this issue Jul 13, 2022 · 2 comments · Fixed by #90
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@daixiang0
Copy link
Owner

Now the order of sections is built-in, users cannot change it.

It would be good to support it.

@daixiang0 daixiang0 added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Jul 13, 2022
@ttys3
Copy link

ttys3 commented Jul 13, 2022

after 0.4.0, the order is breaking change, which caused most of our code changes.

for example:

we use the command:

(currenly we stick to go install github.com/daixiang0/gci@856d805f8f5cde07e7a6ab29d9034f5bc9a954e4)

yes, our imports org the same af #71 (comment):

  • stdlib
  • default
  • org, non-repo
  • org, repo
 gci write -s Std -s Def -s 'Prefix(code.company.com)' -s 'Prefix(code.company.com/sub1/project)' --SkipGeneratedFiles .

before 0.4.0 gci result: standard

 import(
	"fmt"
 
	"golang.org/x/xerrors"
	"go.uber.org/zap"
 
	"code.company.com/sub1/foo"
 
 
	"code.company.com/sub1/project/bar"
 )

0.4.1

gci write -s standard -s default -s 'Prefix(code.company.com)' -s 'Prefix(code.company.com/sub1/project)' --skip-generated .

will result in:

import(
	"fmt"

	"go.uber.org/zap"
	"golang.org/x/xerrors"

	"code.company.com/sub1/project/bar"
	"code.company.com/sub1/sub2/foo"
)

@daixiang0
Copy link
Owner Author

@ttys3 thanks for your report, I will take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants