Open vemv opened 3 years ago
Or, you know, Eastwood could use the actual declared argument list for arity checking, like clj-kondo
does which would obviate the need for all that custom config that Eastwood has had to add over the years to deal with code that uses "human-readable" :arglists
metadata (dating back to at least 2014).
I think we have the same thing in mind: my issue describes interpreting :arglists metadata smartly. disable-warning
would be generally no longer needed for this specific linter.
Eastwood 0.9.7 silences all honeysql false positives for :wrong-arity
I'd still like to interpret the regexes more smartly in a future!
:arglists can use a regex notation:,
?, *, +
e.g. https://github.com/clojure/clojure/blob/b1b88dd25373a86e41310a525a21b497799dbbf2/src/clj/clojure/core.clj#L7724-L7726Eastwood could make a best-effort at expanding these to
&
syntax (internally, non-mutatively) so that defns using such notation don't trigger :bad-arglists faults.Worst-case scenario, any fault coming from an :arglist using regex notation could be automatically omitted.
Finally, if implementing this we could remove https://github.com/jonase/eastwood/blob/2e58aba73c9e39fa98ab46a2ead50d9ec31961e7/resource/eastwood/config/clojure.clj#L113-L117
(note that
?
can more often than not will signal a boolean/predicate)