-
Notifications
You must be signed in to change notification settings - Fork 278
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
Fix a performance regression #995 #998
Fix a performance regression #995 #998
Conversation
When a module is part of a workspace, a call to `go list -m` lists all modules in the workspace, and we need to parse multiple modinfos.
I think you should add a better PR title. I still need a way to fully bypass the Go detection and set a Go version. |
Commit titles and messages contain enough information. If you have a specific PR title in mind, feel free to propose it. Go version chooses the correct set of warnings to enable, so the version detection is a must. |
I suggest: "fix: performance regression"
The Go detection is done inside golangci-lint, golangci-lint doesn't work as revive, so a way to set the Go version is a requirement for us. |
I am not familiar with the way golangci-lint integrates revive and how you intend to use it. Please send patches to add hooks that you need. |
@@ -63,16 +63,48 @@ var ( | |||
func (l *Linter) Lint(packages [][]string, ruleSet []Rule, config Config) (<-chan Failure, error) { | |||
failures := make(chan Failure) | |||
|
|||
perModVersions := make(map[string]*goversion.Version) | |||
perPkgVersions := make([]*goversion.Version, len(packages)) | |||
for n, files := range packages { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 why do you try to detect the Go version per package?
Is it related to sub-modules?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revive's CLI makes it possible to specify many unrelated directories to lint. In the extreme case, every package may come from a different module. Thus per-package detection.
We need to specify the Go version through this function: func (l *Linter) Lint(packages [][]string, ruleSet []Rule, config Config) (<-chan Failure, error) { |
Added an option to override the language version detection to |
Ping @denisvmedia, @chavacava, @ldez. |
Hey, is this repo alive? Can somebody review the PR? @denisvmedia , @chavacava , @ldez ? |
Hi @dominiquelefevre, thanks for the PR. |
Closes #995