The pprint function in the Clojure standard library indents Clojure source
code.

     http://richhickey.github.com/clojure/clojure.pprint-api.html

To get the result you are looking for, a tool would need to walk through all
the *.clj files in your source directory and, for each file, read in the
contents and pprint them back into the same file.

Bonus points for careful error checking - printing into an intermediate
buffer and reading it back in to check that nothing went wrong before
overwriting the original file.

This would make a good Leiningen plug-in, and doesn't sound too difficult to
write.

On Sun, Aug 7, 2011 at 9:17 AM, Philipp Steinwender <
philipp.a.steinwen...@gmail.com> wrote:

> hi!
>
> Is there a tool available that does indentation of clojure code and does
> not depend on an editor/IDE?
>
> we work on the same code together with different editors
> (eclipse+counterclockwise and emacs). We often reindent the other's code
> what leads to changes when we merge our commits with git.
> one way to fix this would be to reindent all source files with an
> indepedent tool before commiting.
>
> Does anybody have similar problems?
>
> Thanks in advance
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to