Skip to content

Typecheck will never output more then 3 #1168

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

Closed
yuanyangen opened this issue May 26, 2020 · 3 comments · Fixed by #1861
Closed

Typecheck will never output more then 3 #1168

yuanyangen opened this issue May 26, 2020 · 3 comments · Fixed by #1861
Labels
bug Something isn't working

Comments

@yuanyangen
Copy link

yuanyangen commented May 26, 2020

this is a old issue, but the previous one (#419) is close, so I create a new one.

after I lookin to the code, I found in : pkg/result/processors/max_per_file_from_linter.go funciton: NewMaxPerFileFromLinter, the maxPerFileFromLinterConfig is set to 3 for typecheck, so the cmd flag:

--max-issues-per-linter

will not work for typecheck

the function code is :

func NewMaxPerFileFromLinter(cfg *config.Config) *MaxPerFileFromLinter {
	maxPerFileFromLinterConfig := map[string]int{
		"typecheck": 3,
	}
	if !cfg.Issues.NeedFix {
		// if we don't fix we do this limiting to not annoy user;
		// otherwise we need to fix all issues in the file at once
		maxPerFileFromLinterConfig["gofmt"] = 1
		maxPerFileFromLinterConfig["goimports"] = 1
	}

	return &MaxPerFileFromLinter{
		flc:                        fileToLinterToCountMap{},
		maxPerFileFromLinterConfig: maxPerFileFromLinterConfig,
	}
}

I'm not familiar with this project, so I don't know why the maxPerFileFromLinterConfig is defined like this. Is there any one can figure it out and make the max-issues-per-linter flag work correctly for typecheck?

@yuanyangen yuanyangen added the bug Something isn't working label May 26, 2020
@boring-cyborg
Copy link

boring-cyborg bot commented May 26, 2020

Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.

@SVilgelm
Copy link
Member

SVilgelm commented Jul 12, 2020

So, this code was added in this commit b361146 first time, but I didn't find any details about this decision. @golangci/core-team Could you please clarify this?

@ldez ldez added the feedback required Requires additional feedback label Feb 21, 2021
@ldez
Copy link
Member

ldez commented Mar 22, 2021

The errors reported by typecheck must be seen as compilation errors, and when a compilation error occurs a lot of "false" compilation errors will be reported like in a classic compilation.
So the limit is here to avoid being flood by those errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants