Skip to content

Commit

Permalink
Check max, min, dissoc, disj, into, disj!, format for redundant call
Browse files Browse the repository at this point in the history
  • Loading branch information
tomdl89 committed Dec 15, 2024
1 parent 97ea8e3 commit 06bef95
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/clj_kondo/impl/config.clj
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,14 @@
clojure.core/some->> cljs.core/some->>
clojure.core/partial cljs.core/partial
clojure.core/comp cljs.core/comp
clojure.core/merge cljs.core/merge}
clojure.core/merge cljs.core/merge
clojure.core/max cljs.core/max
clojure.core/min cljs.core/min
clojure.core/dissoc cljs.core/dissoc
clojure.core/disj cljs.core/disj
clojure.core/into cljs.core/into
clojure.core/disj!
clojure.core/format}
delayed-cfg (fn [config]
(let [cfg (get-in config [:linters :redundant-call])
include (some-> (:include cfg) set)
Expand Down
2 changes: 1 addition & 1 deletion test/clj_kondo/redundant_call_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
^:replace {:linters {:redundant-call {:level :warning}}})

(deftest redundant-call-test
(doseq [sym `[-> ->> some-> some->> partial comp merge]]
(doseq [sym `[-> ->> some-> some->> partial comp merge max min dissoc disj into format]]
(is (empty? (lint! (format "(%s 1 identity)" sym) config))))
(doseq [sym `[-> ->> cond-> cond->> some-> some->> partial comp merge]]
(assert-submaps
Expand Down

0 comments on commit 06bef95

Please sign in to comment.