clojure-emacs/refactor-nrepl — pull request #9 by expez (2014-11-17 13:45:03+00:00)
Title: Add clean-ns

* Eliminate :use clauses
* Sort required libraries, imports and vectors of referred symbols
* Rewrite to favor prefix form, e.g. [clojure [string test]] instead
of two separate libspecs
* Raise errors if any inconsistencies are found (e.g. a libspec
* with more than one alias.
* Remove any duplication in the :require and :import form.
* Returns nil when nothing is changed, so the client knows not to do anything.

For now the pprint code is terrible. I've tried fipp and clojure's own
pprint, but they're both somewhat inadequate. I initially wanted to work
on the entire ns, but given the difficulties involved in pretty-printing I
think a better solution is to just return the new :import and :require
clause to the client so we don't have to worry about messing up everything
else in the (ns.. ) form.

I would like to include the remove-unused-requires functionality in this
operation as well, but I want to get some more eyeballs on this sooner
rather than later.