We're updating the issue view to help you get more done. 

Generating namespace forms

Description

Since tools.namespace supports extracting dependencies from a namespace form (https://github.com/clojure/tools.namespace/blob/master/src/main/clojure/clojure/tools/namespace/parse.cljc#L123), would it also be in scope for tools.namespace to support generating namespace forms?

That is, could we add a function that, given a list of dependent namespaces, java classes, etc., generates a namespace form in a canonical style (e.g., https://stuartsierra.com/2016/clojure-how-to-ns.html)?

My use case is linting/reformatting a few hundred namespace declarations across large enterprise project.
I'd like to do this programmatically — since I haven't found any tools so far, I thought I'd write my own, and would like to make it open source if possible.

Thought I'd run it by y'all first in case it'd be in scope for tools.namespace and there were specific design considerations I should keep in mind before writing the code.
(And no worries if this is out of scope because it's too bike-sheddy, etc.)

Environment

None

Status

Assignee

Stuart Sierra

Reporter

Kevin Lynagh

Labels

None

Approval

None

Patch

None

Priority

Minor