adds integration statuses to bank account pages.

This commit is contained in:
2022-07-08 11:59:59 -07:00
parent 2f2d582a4b
commit 789914b3f7
13 changed files with 234 additions and 58 deletions

View File

@@ -4,4 +4,5 @@
:private-call {:level :off}
:mount/defstate {:level :warning}}
:config-paths ["slingshot"]
:hooks {:analyze-call {mount.core/defstate hooks.defstate/defstate}} }

View File

@@ -0,0 +1,44 @@
(ns clj-kondo.slingshot.try-plus
(:require [clj-kondo.hooks-api :as api]))
(defn expand-catch [catch-node]
(let [[catch catchee & exprs] (:children catch-node)
catchee-sexpr (api/sexpr catchee)]
(cond (vector? catchee-sexpr)
(let [[selector & exprs] exprs]
(api/list-node
[catch (api/token-node 'Exception) (api/token-node '_e#)
(api/list-node
(list* (api/token-node 'let)
(api/vector-node [selector (api/token-node nil)])
exprs))]))
:else catch-node)))
(defn try+ [{:keys [node]}]
(let [children (rest (:children node))
[body catches]
(loop [body children
body-exprs []
catches []]
(if (seq body)
(let [f (first body)
f-sexpr (api/sexpr f)]
(if (and (seq? f-sexpr) (= 'catch (first f-sexpr)))
(recur (rest body)
body-exprs
(conj catches (expand-catch f)))
(recur (rest body)
(conj body-exprs f)
catches)))
[body-exprs catches]))
new-node (api/list-node
[(api/token-node 'let)
(api/vector-node
[(api/token-node '&throw-context) (api/token-node nil)])
(api/token-node '&throw-context) ;; use throw-context to avoid warning
(with-meta (api/list-node (list* (api/token-node 'try)
(concat body catches)))
(meta node))])]
;; (prn (api/sexpr new-node))
{:node new-node}))

View File

@@ -0,0 +1,2 @@
{:hooks
{:analyze-call {slingshot.slingshot/try+ clj-kondo.slingshot.try-plus/try+}}}