Closed pohly closed 1 year ago
The linter is correctly identifying 26 issues in k8s.io/kubernetes/test/e2e/...
That's a manageable number, so I can fix by hand. But being able to fix automatically would still be nicer :smile:
The auto fix does work with the ginkgolinter
executable, using the -fix=true
flag. I'll check why it's not working with golangci-lint.
@pohly - I think it's a golangci-lint limitation. See here for example: https://github.com/golangci/golangci-lint/issues/1779
The ginkgolinter does write SuggestedFixes
and so it's working from the ginkgolinter executable. For now, golangci-lint dose not apply these suggested fixes, and it seems to be a work in progress.
Adding @ldez for reference.
Currently, we don't support SuggestedFixes
but we have an internal way to handle fixes.
So it's not an issue with your linter.
Thanks @ldez . Closing the issue
Describe the bug
I tried ginkgolinter through golangci-lint v1.51.2 on the Kubernetes E2E test suite. When running with
--fix
, it reported an issue, but didn't fix it.To Reproduce
test/e2e/storage/testsuites/subpath.go
:hack/verify-golangci-lint.sh ./test/e2e/storage/testsuites
Once
hack/verify-golangci-lint.sh
has been used once, it is also possible to invokegolangci-lint
manually:Note that the issue gets reported, which implies that https://github.com/golangci/golangci-lint/blob/7ac42b0dde93912bd521d0e89ebef8c191b1d10b/pkg/result/processors/fixer.go#L41-L73 didn't fix it - it's indeed still present in the file.
Expected behavior
It should fix the file.
Environment:
Additional context
After removing the
logcheck
plugin, it is possible to run under dlv:This shows that ginkgolinter didn't provide a replacement, and therefore fixing doesn't work.