Fork me on GitHub

hello, I got in a situation here that I'm not sure how to get out, considering this code:

(let [init-link-events (mapv (fn [cid]
                                     {::client-id cid}]) (range clients))]
       (gen/let [chain-size    (gen-chain-size env)
                 command-chain (gen-command (-> env
                                                (assoc ::chain-size chain-size)
                                                #_(update ::command-pool into init-link-events)))]
         (into init-link-events (chain->list command-chain))))
Kondo thinks there is a redundant let here, but its not really, I understand that for kondo they are just 2 lets, is there a way to avoid this problem?


gen/let vs let


and in my setup gen/let is configured to be resolved as let


hmm, I think we need to tweak the code to disregard things that are linted as let, but are not really clojure.core/lets


@wilkerlucio a workaround for now would be to lint gen/let as core/with-open or something


issue welcome


@borkdude sure, you think this is more a bug or feature request? I'm not sure


I think for the redundant let check we should only look at clojure.core/let only, so I would say it's a bug in that linter


cool, another details that I got now: - clojure.test.check.generators/let is already recognized by kondo (before I said I had configured, but I hadn't) - Trying to make it work as with-open didn't fix got around it


I also made a proposal for built-in support for core.match into clj-kondo for Summer of Bugs. Please upvote the issue with a thumbs up if you'd like to see support for it.