-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
gci linter no longer autofixing import orders #6350
Comments
/assign |
Hm, could it be an alternative to call gci directly as part of lint-fix? I think they did something similar here: https://github.com/vmware-tanzu/cartographer/pull/691/files (although I would still run gci via golangci-lint) I think we need this only until they fixed it in golangci-lint/gci. |
Are folks maintaining golanci-lint aware of this issue? |
There's an issue at golangci/golangci-lint#2604 |
/milestone v1.2 |
I think we have a few options:
Not sure what the best way forward is, given that we don't know how soon they'll fix it. Maybe 2 for now and 3 if they don't fix it soon? |
Okay PR is merged, so we picked 2. Let's see what happens upstream in golangci-lint |
This PR fixes the issue in golangci-lint. We should try to bump the version as soon as there's a new release. |
Yep. We've also asked for a release. One of the maintainers wants to get a few more fixes in before a release, but it seems like they can't find time to implement them unfortunately. See here |
@schrej Your IPAM PR depends on Go 1.18 right? (i.e. using |
Yes. I'm using the shiny new |
We could temporarily disable gci on the CI instead of refactoring that PR, assuming a release with the fix is inbound but just won't make it for 1.2. |
My idea was:
|
If we can get the IPAM PR into 1.2 that way, I can switch it to netaddr, and then switch back after the bump. Having it in a release makes it easier to consume for provider implementations I think. |
Just to confirm. This package is only used in the validating webhook and not as part of the API types? (so changing the package wouldn't be a breaking change to the API types) |
Sorry for this, golangci/golangci-lint#2892 has fixed it, let's wait for the next patch release. |
/triage accepted |
New release has come, please try :) |
It's currently getting tracked via #6737 , the recent golangci lint disabled some linters in revive due to performance issues. |
@killianmuldoon: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Fine for me to close this, but just to mention it. I think usually we shouldn't close issues in favor of PRs. But I guess good for now as we still have #5968. |
gci linter is no longer fixing import order with
make lint-fix
. This issue was noted in #6348. The errors from the linter are opaque making fixing import order a manual and time consuming process for maintainers - and very discouraging for all contributors.It seems from here that the autofix was disabled in a recent version c/f golangci/golangci-lint#2604. I'm still researching why this occurred and will update with any information here.
We can either
gci
from our golangci-lint.Until the linter's behaviour in autofixing comes back in line with expectations. I'm in favour of doing a downgrade - gci was really useful when
make lint-fix
was working./kind bug
[One or more /area label. See https://github.com/kubernetes-sigs/cluster-api/labels?q=area for the list of labels]
The text was updated successfully, but these errors were encountered: