Welcome! Please see the About page for a little more info on how this works.

0 votes
in tools.namespace by

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.)

1 Answer

0 votes
Reference: https://clojure.atlassian.net/browse/TNS-52 (reported by lynaghk)