cluster-api: gci linter no longer autofixing import orders
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 https://github.com/golangci/golangci-lint/issues/2604. I’m still researching why this occurred and will update with any information here.
We can either
- remove
gcifrom our golangci-lint. - or downgrade to an older version, i.e. roll back #6335
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]
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 23 (21 by maintainers)
Sorry for this, https://github.com/golangci/golangci-lint/pull/2892 has fixed it, let’s wait for the next patch release.
I think we should close this in favor of #6737. This no longer represents the issue with golangci-lint as of version 1.47.
This is also being tracked broadly as a part of #release task https://github.com/kubernetes-sigs/cluster-api/issues/5968
/close
My idea was:
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
https://github.com/golangci/golangci-lint/pull/2892
This PR fixes the issue in golangci-lint. We should try to bump the version as soon as there’s a new release.