Skip to content

Commit

Permalink
Fix linting with new clj-kondo (#31)
Browse files Browse the repository at this point in the history
* Fix linting with new clj-kondo

* Better solution to bypass map type check
  • Loading branch information
borkdude authored Sep 29, 2024
1 parent 4615d63 commit f0307ae
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions .clj-kondo/config.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{:config-paths ["../resources/clj-kondo.exports/functionalbytes/mount-lite"]}
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@ pom.xml.asc
.hg/
/mount-lite.iml
.idea/
/.lsp
/.clj-kondo/*
/!.clj-kondo/config.edn
.cache
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
hmap (exprs-map args)]
(when-not (contains? hmap :start)
(throw (ex-info "missing :start expression" {})))
`(def ~name ~hmap)))
`(def ~name (mount.lite/map->State ~hmap))))

(defmacro state [& args]
(let [hmap (exprs-map args)]
(when-not (contains? hmap :start)
(throw (ex-info "missing :start expression" {})))
hmap))
`(mount.lite/map->State ~hmap)))
6 changes: 6 additions & 0 deletions src/mount/lite.clj
Original file line number Diff line number Diff line change
Expand Up @@ -211,3 +211,9 @@
(stop)))))
(.start))
:result p#}))

(comment
(def x 1)
(defstate foo :start (fn [] x))
@foo
)

0 comments on commit f0307ae

Please # to comment.