-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clj-kondo configuration #1
Comments
Hi Derek, Yes, for sure. That way many clj-kondo users benefit from better linting. |
Got it working like that (based on (ns hooks.redelay
(:require [clojure.string :as str]))
(defn- qualified-exprs [qualifiers exprs]
(loop [qualifiers (set qualifiers)
exprs exprs
qualifier nil
qualified {}]
(if (seq exprs)
(let [expr (first exprs)]
(if-let [qualifier (qualifiers expr)]
(recur (disj qualifiers qualifier) (rest exprs) qualifier qualified)
(recur qualifiers (rest exprs) qualifier (update qualified qualifier (fnil conj []) expr))))
qualified)))
(defmacro defstate [name & args]
(let [{:keys [start stop] names :name metas :meta implicit-start nil}
(qualified-exprs [:name :start :stop :meta]
(concat [:name name] args))
start (or start implicit-start)
hmap {:name (first names)
:start-fn `(fn [] ~@start)
:stop-fn (if (str/includes? (str stop) "this")
`(fn [~'this] ~@stop)
`(fn [] ~@stop))
:meta (first metas)}]
`(def ~name (redelay.core/map->State ~hmap)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there any interest in clj-kondo configuration? I see
mount-lite
has some hooks defined.The text was updated successfully, but these errors were encountered: