-
Notifications
You must be signed in to change notification settings - Fork 8
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
Can we detect generated file like VSCode or Jetbrains do? #11
Comments
This might be better solved with issues:
exclude-rules:
- path: path/to/generated/code.go
linters:
- funlen |
@robinknaapen You think this is also solved with #18 ? |
I thought that golangci-lint already ignored generated files by default. The following example does not trigger funlen Given this basic config linters:
disable-all: true
enable:
- funlen
linters-settings:
funlen:
lines: 5
statements: 10 And this code
package main
import "fmt"
func main() {
fmt.Println(Generated())
}
// Code generated by Crow, DO NOT EDIT
package main
func Generated() string {
// I have a lot of
// comments
// This will trigger the linter
//
//
// for sure :)
return "generated"
} |
Am I correct on my previous comment? I am kind of reluctant to add another "hint" to the README. Since most of the cases can be distilled from the official documentation better. |
I'm sorry. I'm not using Go these days. I can't help. |
@robinknaapen yes you are right, autogenerated code is detected by golangci-lint. |
Then I can close this issue I suppose. If I am wrong, feel free to re-open |
Can we detect generated file like VSCode or Jetbrains do?
Using top line in file like:
// Code partially generated.
or// Code generated by xxx, DO NOT EDIT.
.In generated files we can have very long functions.
The text was updated successfully, but these errors were encountered: