greglook / cljstyle

A tool for formatting Clojure code
Eclipse Public License 1.0
293 stars 39 forks source link

Running cljfmt with only `: insert-padding-lines?` enabled produces non-blank-line changes #4

Closed drewinglis closed 5 years ago

drewinglis commented 5 years ago
$ cat .cljfmt 
{:max-blank-lines 3
 :single-import-break-width 1000
 :indentation? false
 :remove-surrounding-whitespace? false
 :remove-trailing-whitespace? false
 :insert-missing-whitespace? false
 :remove-consecutive-blank-lines? false
 :insert-padding-lines? true
 :rewrite-namespaces? false}
$ cat foo.clj
(ns foo)

(defn foo-two []
  nil)
$ cljfmt check foo.clj 
--- a/foo.clj
+++ b/foo.clj
@@ -1,4 +1,6 @@
 (ns foo)

-(defn foo-two []
+
+(defn foo-two
+  []
   nil)
1 files formatted incorrectly

I would expect the diff to be:

$ cljfmt check foo.clj 
--- a/foo.clj
+++ b/foo.clj
@@ -1,4 +1,6 @@
 (ns foo)

+
(defn foo-two []
   nil)
1 files formatted incorrectly
drewinglis commented 5 years ago

Should probably dupe this into #9 I guess...