Merge pull request #133 from NoahTheDuke/nb/fix-clj-kondo-config

Update defstate clj-kondo hook to return a var
This commit is contained in:
Anatoly 2024-08-21 22:43:40 -04:00 committed by GitHub
commit b89b930ec2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 13 additions and 8 deletions

1
.clj-kondo/config.edn Normal file
View file

@ -0,0 +1 @@
{:config-paths ["../resources/clj-kondo.exports/mount/mount/"]}

1
.gitignore vendored
View file

@ -21,3 +21,4 @@ doo-index.html
/.nrepl-history
.cljs_rhino_repl/
out/
.clj-kondo/.cache

View file

@ -1,3 +1,3 @@
{:lint-as {mount.core/defstate clojure.core/def-catch-all}
:linters {:mount/defstate {:level :warning}}
:hooks {:analyze-call {mount.core/defstate hooks.defstate/defstate}}}
{:linters {:mount/defstate {:level :warning}}
:hooks {:analyze-call {mount.core/defstate hooks.defstate/defstate
mount.core/defstate! hooks.defstate/defstate}}}

View file

@ -32,8 +32,10 @@
:col (:col (meta n))})
:else
{:node (api/list-node
(list*
(api/token-node 'fn*)
(api/vector-node [n])
(list
(api/token-node 'def)
n
args))})))
(api/list-node
(list*
(api/token-node 'do)
args))))})))

View file

@ -6,8 +6,9 @@
(defn entity [conn id]
(d/entity (d/db conn) id))
(defn touch [conn results]
(defn touch
"takes 'entity ids' results from a query
e.g. '#{[272678883689461] [272678883689462] [272678883689459] [272678883689457]}'"
[conn results]
(let [e (partial entity conn)]
(map #(-> % first e d/touch) results)))