Skip to content

Commit dbbea15

Browse files
committed
Add let* to default indents (fixes #168)
1 parent ba853b7 commit dbbea15

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

cljfmt/resources/cljfmt/indents/clojure.clj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
if-not [[:block 1]]
4444
if-some [[:block 1]]
4545
let [[:block 1]]
46+
let* [[:block 1]]
4647
letfn [[:block 1] [:inner 2 0]]
4748
locking [[:block 1]]
4849
loop [[:block 1]]

cljfmt/test/cljfmt/core_test.cljc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,18 @@
744744
" (str x 2"
745745
" 3 4)))"])))
746746

747+
(testing "let blocks"
748+
(is (reformats-to?
749+
["(let [x 1]"
750+
"(+ x 1))"]
751+
["(let [x 1]"
752+
" (+ x 1))"]))
753+
(is (reformats-to?
754+
["(let* [x 1]"
755+
"(+ x 1))"]
756+
["(let* [x 1]"
757+
" (+ x 1))"])))
758+
747759
(testing "multiline right hand side forms"
748760
(is (reformats-to?
749761
["(list foo :bar (fn a"

0 commit comments

Comments
 (0)