Skip to content
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

autogenerated_exclude: bufio.Scanner: token too long #954

Closed
ernado opened this issue Feb 3, 2020 · 2 comments · Fixed by #955
Closed

autogenerated_exclude: bufio.Scanner: token too long #954

ernado opened this issue Feb 3, 2020 · 2 comments · Fixed by #955
Assignees
Labels
bug Something isn't working

Comments

@ernado
Copy link
Member

ernado commented Feb 3, 2020

As mentioned in comment by @agnivade:

Ok, so this error has gone away, but this release seems to have new bugs :(

WARN [runner] Can't process result by autogenerated_exclude processor: can't filter issue result.Issue{FromLinter:"golint", Text:"exported var SystemEmojis should have comment or be unexported", SourceLines:[]string(nil), Replacement:(*result.Replacement)(nil), Pkg:(*packages.Package)(0xc0017860f0), LineRange:(*result.Range)(nil), Pos:token.Position{Filename:"model/emoji_data.go", Offset:132, Line:6, Column:5}, HunkPos:0}: failed to get doc of file model/emoji_data.go: failed to scan file: bufio.Scanner: token too long 

It seems like #484, but it wasn't there in 1.21.

We cannot migrate to 1.23.2 unless we get a clean output without any warnings.

I am going to close this issue as this seems to have been fixed. Thanks for your work.

Seems like we can just increase buffer size of scanner.

@ernado ernado added the bug Something isn't working label Feb 3, 2020
@ernado ernado self-assigned this Feb 3, 2020
ernado added a commit to ernado/golangci-lint that referenced this issue Feb 3, 2020
Some lines can be very long, so increase scanner
buffer to mitigate this.

Fix golangci#954
ernado added a commit to ernado/golangci-lint that referenced this issue Feb 3, 2020
Some lines can be very long, so increase scanner
buffer to mitigate this.

Fix golangci#954
ernado added a commit that referenced this issue Feb 3, 2020
* autogenerated_exclude: increase scanner buffer

Some lines can be very long, so increase scanner
buffer to mitigate this.

Fix #954
@JekaMas
Copy link

JekaMas commented Feb 28, 2020

First of all, thank you @ernado for your great project.

Could you help us with the issue that we do have files like ~900Kb https://github.com/ethereum/go-ethereum/blob/master/core/genesis_alloc.go
It causes constant linters failure with an error:

Can't process result by autogenerated_exclude processor: can't filter issue result.Issue{FromLinter:\"golint\", Text:\"should have a package comment, unless it's in another file for this package\", SourceLines:[]string(nil), Replacement:(*result.Replacement)(nil), Pkg:(*packages.Package)(0xc001737e00), LineRange:(*result.Range)(nil), Pos:token.Position{Filename:\"core/genesis_alloc.go\", Offset:793, Line:17, Column:1}, HunkPos:0}: failed to get doc of file core/genesis_alloc.go: failed to scan file: bufio.Scanner: token too long"

@ernado
Copy link
Member Author

ernado commented Feb 28, 2020

Hey @JekaMas, please check v1.23.7

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.

2 participants