Closed sheluchin closed 2 years ago
@sheluchin Thanks for your reporting!
Interesting. I could reproduce.
@sheluchin It seems a cljfmt side bug.
$ cat foo.clj
(ns foo)
(-> {:x 1}
:x
prn)
$ cat indentation.clj
{#"^\w" [[:inner 0]]}
$ clojure -Sdeps '{:deps {cljfmt/cljfmt {:mvn/version "0.8.0"}}}' -M -m cljfmt.main check foo.clj
foo.clj has incorrect formatting
--- a/private/tmp/bar/foo.clj
+++ b/private/tmp/bar/foo.clj
@@ -1,5 +1,5 @@
(ns foo)
(-> {:x 1}
- :x
- prn)
+ :x
+ prn)
1 file(s) formatted incorrectly
$ clojure -Sdeps '{:deps {cljfmt/cljfmt {:mvn/version "0.8.0"}}}' -M -m cljfmt.main check --indents indentation.clj foo.clj
All source files formatted correctly
$ cat bar.clj
;(ns foo)
(-> {:x 1}
:x
prn)
$ clojure -Sdeps '{:deps {cljfmt/cljfmt {:mvn/version "0.8.0"}}}' -M -m cljfmt.main check --indents indentation.clj bar.clj
bar.clj has incorrect formatting
--- a/private/tmp/bar/bar.clj
+++ b/private/tmp/bar/bar.clj
@@ -1,5 +1,5 @@
;(ns foo)
(-> {:x 1}
- :x
- prn)
+ :x
+ prn)
1 file(s) formatted incorrectly
@liquidz I opened that :point_up: issue in the cljfmt issue tracker. I hope I summarized it well enough to capture the point. I'll close this vim-iced issue as it's not really a vim-iced concern, as far as I understand. Thank you for investigating!
Using Tonsky's formatting rule with Parinfer disabled:
:IcedFormat
::IcedFormatAll
And I notice that if comment out the ns form at the top, the behaviour becomes consistent:
:IcedFormatAll