Add a max argument linter to our golangci-lint configuration
Problem to solve
Our Go style guidelines do not include any guidance on the max limit for function arguments. This creates ambiguity and can lead to varying decisions on what is considered too long of a function signature.
Proposal
- We should update the Go guide to establish a max limit of arguments. For example,
46 seems to be a reasonably balanced limit (see #7371 (comment 2912343518)). - Add a linter to enforce this rule in our project. The
revivelinter ingolangci-linthas an option to enable a lint rule for arg limits. - Announce this in the #golang Slack channel.
Further details
Discussed in !1345 (comment 1601195994)
Links / references
Edited by Oscar Tovar