nedap / formatting-stack

An efficient, smart, graceful composition of Clojure formatters, linters and such.
Eclipse Public License 2.0
99 stars 2 forks source link

Type hint shortener #67

Open vemv opened 5 years ago

vemv commented 5 years ago

I think it would be relatively easy to implement a formatter that achieved the following:

- (speced/defn safely-read-ns-contents [^string? buffer, ^clojure.lang.Namespace ns-obj]
+ (speced/defn safely-read-ns-contents [^string? buffer, ^Namespace ns-obj]
vemv commented 4 years ago

Also: insert :import statements if missing (people may refer to classes without importing them)

Little caveat: speced.def uses e.g. ^int? metadata, which may translate to {:tag int?} and confuse this formatter.