NoahTheDuke / splint

A Clojure linter focused on style and code shape.
https://cljdoc.org/d/io.github.noahtheduke/splint/
Mozilla Public License 2.0
115 stars 2 forks source link

`cond->` with `merge` incorrectly trips `lint/redundant-call` #21

Closed danieroux closed 1 month ago

danieroux commented 2 months ago

This trips [lint/redundant-call] - Single-arg merge always returns the arg:

(let [flag true]
  (cond-> {::foo "FOO"}
    flag (merge {::bar "BAR"})))
dpassen commented 2 months ago

Just ran into this, happy to see it documented.

NoahTheDuke commented 2 months ago

Thanks for the report. I gotta figure out a better way to handle macros than just checking everything for -> in the parent form hah.

NoahTheDuke commented 2 months ago

Fixed in 72add52, release forthcoming.

NoahTheDuke commented 1 month ago

Released in 1.17.0.