greglook / cljstyle

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

Running cljfmt with all rules disabled still produces diffs #9

Closed drewinglis closed 4 years ago

drewinglis commented 5 years ago

The most notable diff is that for named functions it doesn't allow the arguments list to stay on the same line:

$ cljfmt check foo.clj 
--- a/foo.clj
+++ b/foo.clj
@@ -1,2 +1,3 @@
-(fn foo [arg-one]
+(fn foo
+[arg-one]
   nil)
1 files formatted incorrectly
$ cat foo.clj 
(fn foo [arg-one]
  nil)
greglook commented 5 years ago

:line-break-functions? controls this behavior and wasn't disabled by your config. It was also missing from the README. Added in 7c5d943762a6ce4e82c8a14fae0db100bccb0844.

greglook commented 5 years ago

I wonder if it's worth adding a --no-defaults option to the CLI to better support this sort of isolation. 🤔

drewinglis commented 5 years ago

I'm fine with closing this out with the resolution being "fixed docs". I think as long as you give the user a way to run it with everything turned off then that's fine. I don't think a special option is needed, though I would probably still use it.