-
Notifications
You must be signed in to change notification settings - Fork 285
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 enforce-repeated-arg-type-style
rule finds some false positives.
#1032
Comments
Thanks for reporting this. I will check it. |
@denisvmedia With the same config and the same code as in issue description I got:
As you can see, there are a lot of |
I'm not sure there is a better way than just ignore the invalid types. I don't think we can efficiently parse the types from the imported packages. We could have probably manually analyzed the symbols (the package name/alias + the type name), but I'm not sure it's a good idea. It needs to be carefully verified. For now, I submitted a PR that limits the checks to the current package types + any basic type. I'm afraid, it's the best we can do now. See #1046 |
Hi @zak-pawel, I've made a PR #1049 with a new implementation of the rule that avoids using type information thus more simple and CPU efficient. Could you please check if the proposed implementation works okay for your case? cc: @denisvmedia |
@chavacava |
Describe the bug
The
enforce-repeated-arg-type-style
rule finds some false positives. 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:
go install github.com/mgechev/revive@latest
Expected behavior
I would like only the findings that are not false positives to be shown.
Logs
Some examples:
plugins/inputs/webhooks/artifactory/artifactory_webhook.go:23:87: repeated argument type can be omitted
:plugins/outputs/bigquery/bigquery.go:244:45: repeated argument type can be omitted
:plugins/outputs/mqtt/mqtt_test.go:803:59: repeated argument type can be omitted
:Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: