Skip to content

Commit

Permalink
Add clj-kondo config
Browse files Browse the repository at this point in the history
  • Loading branch information
aroemers committed Nov 6, 2024
1 parent adfeae1 commit cb9eeb1
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions .clj-kondo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.cache/
6 changes: 6 additions & 0 deletions .clj-kondo/config.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{:hooks {:macroexpand {redelay.core/state core/state}}
:config-in-call {redelay.core/state
{:linters {:unresolved-symbol {:exclude-patterns ["^this"]}}}
redelay.core/defstate
{:linters {:unresolved-symbol {:exclude-patterns ["^this"]}}}}
:lint-as {redelay.core/defstate clojure.core/def}}
4 changes: 4 additions & 0 deletions .clj-kondo/core.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(ns core)

(defmacro state [& exprs]
(reduce #(conj %1 (cond-> %2 (= (last %1) :name) str)) [] exprs))
4 changes: 2 additions & 2 deletions src/redelay/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
(throw (ex-info "Exception thrown when closing state" {:state this} e)))))))

clojure.lang.IPersistentStack
(peek [this]
(peek [_]
(let [v @value]
(when (not= v unrealized)
v)))
Expand Down Expand Up @@ -115,7 +115,7 @@
, [{:doc arg1} (rest exprs)]
(and (map? arg1) (or start arg2))
, [arg1 (rest exprs)]
:otherwise
:else
, [nil exprs])))

(declare state?)
Expand Down
2 changes: 1 addition & 1 deletion test/redelay/core_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

(deftest simple-test
(let [foo (state 1)
bar (state :start (inc @foo) :name bar)
bar (state :start (inc @foo) :name bar :stop this)
stopped (promise)]

(defstate ^:private baz "docstring" {:extra "attr"}
Expand Down

0 comments on commit cb9eeb1

Please sign in to comment.