Skip to content

Commit

Permalink
Update changelog, add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tomdl89 committed Nov 11, 2024
1 parent c6c9f1b commit f6bf905
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ For a list of breaking changes, check [here](#breaking-changes).
- [#2407](https://github.com/clj-kondo/clj-kondo/issues/2407): support ignore hint on called symbol
- [#2420](https://github.com/clj-kondo/clj-kondo/issues/2420): Detect uneven number of clauses in `cond->` and `cond->>`
- [#2415](https://github.com/clj-kondo/clj-kondo/issues/2415): false positive type checking issue with `str/replace` and `^String` annotation
- [#2212](https://github.com/clj-kondo/clj-kondo/issues/2212): new linter: `:redundant-nesting`

## 2024.09.27

Expand Down
17 changes: 17 additions & 0 deletions test/clj_kondo/redundant_nesting_test.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
(ns clj-kondo.redundant-nesting-test
(:require [clj-kondo.test-utils :refer [lint! assert-submaps]]
[clojure.test :refer [deftest is testing]]))

(deftest redundant-nesting-test
(assert-submaps
'({:file "<stdin>", :row 1, :col 10, :level :warning, :message "Nested use of min is redunant"})
(lint! "(min 5 2 (min 3 7))"))
(assert-submaps
'({:file "<stdin>", :row 1, :col 8, :level :warning, :message "Nested use of * is redunant"})
(lint! "(* 3 4 (* 5 6))"))
(assert-submaps
'({:file "<stdin>", :row 1, :col 18, :level :warning, :message "Nested use of str is redunant"})
(lint! "(str \"foo\" \"bar\" (str \"baz\" \"qux\"))"))
(assert-submaps
'({:file "<stdin>", :row 1, :col 21, :level :warning, :message "Nested use of concat is redunant"})
(lint! "(concat [1 2] [3 4] (concat [5 6] [7 8]))")))

0 comments on commit f6bf905

Please sign in to comment.