Skip to content

Typecheck will never output more then 3  #1168

Closed
@yuanyangen

Description

@yuanyangen

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions