Add clj-surgeon config (#74855)
This commit is contained in:
27
.clj-surgeon.edn
Normal file
27
.clj-surgeon.edn
Normal file
@@ -0,0 +1,27 @@
|
||||
{:aliases
|
||||
{;; defendpoint shape: (api.macros/defendpoint METHOD URL DOCSTRING? [args] body)
|
||||
;; No name slot — synthesize :route [METHOD "path"] from first 2 args.
|
||||
"defendpoint"
|
||||
{:fields {:method (fn [z] (some-> z z/down z/right z/sexpr name str/upper-case))
|
||||
:path (fn [z] (-> z z/down z/right z/right z/sexpr))}}
|
||||
|
||||
;; defenterprise shape:
|
||||
;; (defenterprise NAME DOCSTRING? EE-NAMESPACE [args] body)
|
||||
"defenterprise"
|
||||
{:fields {:name ->defn-name
|
||||
:ee-namespace (fn [z]
|
||||
;; Skip name + optional docstring; the next
|
||||
;; symbol is the EE namespace.
|
||||
(let [name-z (-> z z/down z/right)
|
||||
after-doc (z/right name-z)
|
||||
candidate (if (string? (try (z/sexpr after-doc)
|
||||
(catch Exception _ nil)))
|
||||
(z/right after-doc)
|
||||
after-doc)]
|
||||
(try (let [v (z/sexpr candidate)]
|
||||
(when (symbol? v) v))
|
||||
(catch Exception _ nil))))
|
||||
:arglist ->defn-arg-list}}
|
||||
|
||||
"defsetting"
|
||||
{:fields {:name ->defn-name}}}}
|
||||
Reference in New Issue
Block a user