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 autofix for gci #2604

Closed
barweiss opened this issue Feb 20, 2022 · 4 comments · Fixed by #2892
Closed

Add autofix for gci #2604

barweiss opened this issue Feb 20, 2022 · 4 comments · Fixed by #2892
Labels
enhancement New feature or improvement

Comments

@barweiss
Copy link

barweiss commented Feb 20, 2022

Your feature request related to a problem? Please describe.

We were using the GCI linter to enforce import order. However, with the 1.44.2 update, it seems like auto-fix support was dropped.
This change makes it harder to enforce import order as the developer has to manually fix the code.

Describe the solution you'd like.

It seems like GCI supports write mode. Using it for auto fix could be possible.

Describe alternatives you've considered.

Removing the GCI linter as it is currently unusable, or downgrading golangci-lint.

Additional context.

No response

@barweiss barweiss added the enhancement New feature or improvement label Feb 20, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented Feb 20, 2022

Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.

@ldez
Copy link
Member

ldez commented Feb 20, 2022

kind of duplicate of #2591

@barweiss
Copy link
Author

Yea, sorry, I missed the closed issue.
I see that you closed it due to GCI not supporting autofix, however, it seems like the "write" command does fix the import order.

@barweiss
Copy link
Author

Anyway, I may be out of line here, but even though GCI is not a responsibility of the golangci-lint team, this change affects everyone that uses the GCI linter and relied on the autofix behavior.
I would suggest downgrading GCI specifically if possible until this issue is sorted (perhaps allowing the newer version to be used or evaded using the configuration).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement
Projects
None yet
2 participants