-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Improve generated files detection #1083
Comments
Looking through how golangci-lint looks for auto-generated code - it appears the C style comment block above the code gen line is the issue. This causse the loop to break and it never sees the auto-gen line. In fact, if I removed that first comment from the generated file - it golangci-lint correctly determined it was an auto-generated file. It is this code here that seems to be the problem: golangci-lint/pkg/result/processors/autogenerated_exclude.go Lines 133 to 142 in eeff390
|
As mentioned in golang/go#13560 (comment):
So your file is correct and we should improve detection logic. |
Fixed by #1161 |
golangci-lint is not ignoring auto generated files like it is supposed to. The autogenerated files are made by open-api generator. Here is a part of the top of one of the generated files:
Thank you for creating the issue!
Please include the following information:
Version of golangci-lint
Config file
$ golangci-lint run --fix --no-config --disable-all -E gofmt -E govet -E errcheck -E staticcheck -E unused -E gosimple -E structcheck -E varcheck -E ineffassign -E deadcode -E typecheck -E gosec ./...
Go environment
The text was updated successfully, but these errors were encountered: