gfredericks / test.chuck

A utility library for test.check
Eclipse Public License 1.0
215 stars 26 forks source link

Analyse `(checking` description in clj-kondo hook #72

Closed dzhus closed 3 years ago

dzhus commented 3 years ago

This is a follow-up to https://github.com/gfredericks/test.chuck/pull/69.

This makes clj-kondo analyse (checking form description too, which makes a difference if it's not a literal, for example:

(ns checking-test
 (:require [my.ns :as some-ns-that-would-be-flagged-as-unused-without-this-change]))

...

(checking (some-ns-that-would-be-flagged-as-unused-without-this-change/myfun) 100 ...)
gfredericks commented 3 years ago

Thanks!

dzhus commented 3 years ago

@gfredericks can you please push a release with this change included? 🙏

gfredericks commented 3 years ago

Released as 0.2.12

dpassen commented 3 years ago

Could we have just put the desc inside the body of the let as we did with opts instead of binding it inside the let?

dzhus commented 3 years ago

@dpassen As if we were linting

(let [<bindings>]
  desc
  opts
  body)

? yeah I think this would work too and is a simpler solution.

I think I didn't do this instinctively because I assumed that desc would not be side-effecting, so having it in front of body shouldn't change the semantics of let, so it shouldn't be there, so some day the linting tool might start complaining about it! Although clj-kondo can't tell any of that, at least at the moment.