Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Add clj-surgeon config (#74855)

bryan7b466c9b862b
diff --git a/.clj-surgeon.edn b/.clj-surgeon.edn
new file mode 100644
index 00000000000..abca358caf2
--- /dev/null
+++ b/.clj-surgeon.edn
@@ -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}}}}