mgechev / revive

🔥 ~6x faster, stricter, configurable, extensible, and beautiful drop-in replacement for golint
https://revive.run
MIT License
4.74k stars 276 forks source link

extended [allowRegex] parameter for `unused-parameter` and `unused-receiver` rules #858

Closed comdiv closed 1 year ago

comdiv commented 1 year ago

Impl for #613 feature-request

Now can provide custom regexes for unused-parameter and unused-receiver to allow names matching some regex, no just _ itself (does'nt break default behavior)

[rule.unused-parameter]
     Arguments = [ { allowRegex = "^_" } ]

[rule.unused-receiver]
     Arguments = [ { allowRegex = "^_" } ]
chavacava commented 1 year ago

Hi @comdiv, thanks for the PR. Please open an issue before opening a PR. Opening an issue will let us discuss on the subject and find the right way to cope with the request.

comdiv commented 1 year ago

Sorry, i thought it was open early - it's fix for old issue #613 - what exatly i have to do?