New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linebreaking and re-indenting? #120

Open
danielcompton opened this Issue May 5, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@danielcompton

danielcompton commented May 5, 2018

These forms are both treated by lein-cljfmt 0.5.7 as fine and not needing any repair, even though neither is very idiomatic Clojure.

(ns test1
     (:require [clojure.edn :as edn]
               [clojure.java.io :as io]))
(ns test1 (:require [clojure.edn :as edn] [clojure.java.io :as io]))

What are your thoughts on making cljfmt re-indent files, and also break them (in some circumstances, probably can't always do this)?

My dream is for a Clojure formatting tool which would always converge to reformat to the same file, no matter how much whitespace was (or wasn't) in between the tokens in the original file. I'm not sure how opinionated cljfmt wants to be though?

@weavejester

This comment has been minimized.

Owner

weavejester commented May 5, 2018

I think that's a good idea; however, my goal with cljfmt wasn't to provide a canonical format, but to fix any formatting issues that were obviously wrong.

Have you looked into zprint? You may find that more what you want to do.

@danielcompton

This comment has been minimized.

danielcompton commented May 5, 2018

I’ve seen zprint, it does do more breaking than cljfmt, but is extremely configurable. Ideally I’d use a tool with zero/minimal config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment