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

The max-public-structs rule starts finding many false positives in version 1.5.0 #1103

Open
zak-pawel opened this issue Nov 9, 2024 · 1 comment · May be fixed by #1114
Open

The max-public-structs rule starts finding many false positives in version 1.5.0 #1103

zak-pawel opened this issue Nov 9, 2024 · 1 comment · May be fixed by #1114
Assignees
Labels

Comments

@zak-pawel
Copy link

Describe the bug
The max-public-structs rule starts finding many false positives in version 1.5.0.
Version 1.4.0, with the same configuration, doesn't find any findings.
I will demonstrate this using the repository https://github.com/influxdata/telegraf (over 650k lines) as an example.

To Reproduce
Steps to reproduce the behavior:

  1. I updated revive go install github.com/mgechev/revive@latest
  2. I cloned repo and switched to particular branch
git clone https://github.com/influxdata/telegraf.git
cd telegraf
git checkout v1.32.2
  1. I run it with the following flags & configuration file:
# flags
revive -config revive.toml ./... | sort
#revive.toml
[rule.max-public-structs]
  arguments = [14]
  1. There are a 632 false positives.

Expected behavior
I would like there to be no findings for the given repo, branch and configuration - just as it was for the previous version of revive (1.4.0)."

Logs
All findings attached:
revive_1.5.0_findings_for_telegraf.txt

Desktop (please complete the following information):

  • OS: Ubuntu 23:10
  • Version of Go:
$ go version 
go version go1.23.3 linux/amd64
@chavacava
Copy link
Collaborator

Hi @zak-pawel thanks for reporting the issue. I'll check what is happening (BTW, the failure message does not help in knowing what is the actual limit the linter is checking 👎 )

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