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

Extend :discouraged-var to allow specifying arities #2219

Open
imrekoszo opened this issue Nov 21, 2023 · 0 comments
Open

Extend :discouraged-var to allow specifying arities #2219

imrekoszo opened this issue Nov 21, 2023 · 0 comments
Projects

Comments

@imrekoszo
Copy link
Contributor

To upvote this issue, give it a thumbs up. See this list for the most upvoted issues.

Is your feature request related to a problem? Please describe.
I often want to discourage the use of certain arities of functions.

For example, in the case of clojure.core/map I like to see the 1-arity being used, which returns a transducer. However its higher arities return lazy sequences which I consider a mediocre abstraction for most of the cases I encounter. I would like clj-kondo to help me identify these calls so I can decide whether they are justified or not.

Describe the solution you'd like
As per this slack thread the suggestion is to extend the :discouraged-var linter to allow specifying arities that are discouraged through something like a block list :arities #{2, 3, :varargs} or allowing for certain arities :allow-arities #{1}

Describe alternatives you've considered
If intermediate lazy sequences are generally considered an anti-pattern then there could exist a more specific linter.

@borkdude borkdude added this to Needs triage in clj-kondo via automation Nov 21, 2023
@borkdude borkdude moved this from Needs triage to Medium priority (new / enhance) in clj-kondo Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
clj-kondo
  
Medium priority (new / enhance)
Development

No branches or pull requests

1 participant