Skip to content

Typecheck will never output more then 3 issues #419

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
svanharmelen opened this issue Mar 7, 2019 · 6 comments
Closed

Typecheck will never output more then 3 issues #419

svanharmelen opened this issue Mar 7, 2019 · 6 comments

Comments

@svanharmelen
Copy link

I am trying to switch from gometalinter, but have an issue with getting the typecheck to work as expected.

No matter what config I give it, it will only output a maximum of 3 issues (see output below, I used package github.com/xanzy/go-gitlab to test with).

Now I did see this in the code and wondered if that caused this hard fixed number. If so I wonder if I can override that somehow, or that this hardcoded limit should be removed?

Please include the following information:

  1. Version of golangci-lint: golangci-lint has version 1.15.0 built from 901cf25 on 2019-02-18T08:22:26Z
  2. Config file: N/A
  3. Go version: go version go1.12 darwin/amd64
  4. Verbose output of running golangci-lint run --disable-all --enable=typecheck --max-same-issues=50 -v gitlab.go:
➜  go-gitlab git:(master) golangci-lint run --disable-all --enable=typecheck --max-same-issues=50 -v gitlab.go
INFO [config_reader] Config search paths: [./ /Users/sander/GoCode/src/github.com/xanzy/go-gitlab /Users/sander/GoCode/src/github.com/xanzy /Users/sander/GoCode/src/github.com /Users/sander/GoCode/src /Users/sander/GoCode /Users/sander /Users /]
INFO [lintersdb] Active 1 linters: [typecheck]
INFO [loader] Go packages loading at mode load types and syntax took 941.838783ms
INFO [loader] Packages that do not compile: [command-line-arguments]
INFO [runner] worker.3 took 785ns
INFO [runner] worker.4 took 4.757µs
INFO [runner] worker.2 took 3.239µs
INFO [runner] worker.1 took 232.385µs with stages: typecheck: 218.038µs
INFO [runner] Workers idle times: #2: 143.437µs, #3: 174.623µs, #4: 169.542µs
gitlab.go:289:25: undeclared name: `AccessRequestsService` (typecheck)
INFO [runner] Issues before processing: 66, after processing: 3
        AccessRequests        *AccessRequestsService
                               ^
gitlab.go:290:25: undeclared name: `AwardEmojiService` (typecheck)
        AwardEmoji            *AwardEmojiService
                               ^
gitlab.go:291:25: undeclared name: `IssueBoardsService` (typecheck)
        Boards                *IssueBoardsService
INFO [runner] processing took 3.390262ms with stages: exclude: 1.227094ms, identifier_marker: 847.713µs, cgo: 442.088µs, skip_dirs: 408.59µs, source_code: 262.358µs, path_prettifier: 80.714µs, nolint: 62.843µs, uniq_by_line: 27.824µs, autogenerated_exclude: 9.168µs, max_per_file_from_linter: 9.025µs, max_same_issues: 6.341µs, path_shortener: 1.968µs, max_from_linter: 1.8µs, replacement_builder: 1.28µs, diff: 926ns, exclude-rules: 301ns, skip_files: 229ns
                               ^
INFO Memory: 11 samples, avg is 68.7MB, max is 68.7MB
INFO Execution took 1.078433168s
@jirfag
Copy link
Contributor

jirfag commented Mar 31, 2019

Hi,
I did it to not annoy users with a lot of similar messages. Too often one logical error (e.g. no installed dependency) makes dozens of similar warnings.

Why would you like to see > 3 issues from typecheck per file?

@jen20
Copy link

jen20 commented Apr 1, 2019

I ran into this by accident just now looking for something else relating to golangci-lint, but the reason I would like all of the error messages is so that when there are linting errors in CI, I have a complete list of locations to go fix.

@jirfag
Copy link
Contributor

jirfag commented Apr 20, 2019

We can make an option in config for disabling such hardcoded limits

@svanharmelen
Copy link
Author

That shoulds like a good way forward to me!

@matoous
Copy link
Contributor

matoous commented Sep 25, 2019

You can use

--max-issues-per-linter int   Maximum issues count per one linter. Set to 0 to disable (default 50)
--max-same-issues int         Maximum count of issues with the same text. Set to 0 to disable (default 3)

To configure number of errors displayed.
Closing.

@matoous matoous closed this as completed Sep 25, 2019
@svanharmelen
Copy link
Author

Nice 👍 Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants